I recently created a Debian package for my Gtk 3.0, Vala app and tested installing it onto a live Ubuntu Budgie 24.04 session. The install itself worked just fine. The app is run from the system menu and everything seems normal except that it cannot access the one file it needs that was installed in the app’s folder beneath /usr/share – its help documentation file that should open when the user clicks “Help” on the app’s menu. Instead, the app displays a “permission denied” error. Okay, so my user is the “live user” logged into the live session and perhaps this user doesn’t have the necessary permissions to “read” a file stored beneath /usr/share? What puzzles me is that although I can’t access this file via my newly installed app, I can open a terminal and cat the file’s contents just fine. Plus, I can open the file in GEdit… What in the world could it be about my app that makes it behave different from other apps when reading this file? It seems I’m failing to understand some fundamental concept here, like how permissions work, lol… The file’s permissions are set as “644” and all enclosing directories are set as “755” with the owner of everything being “root”. Please help!
Hi @Underdog and congratulations!
Dumb question: why not try out your application on an installed distribution? At least you wouldn’t have to ask such questions.
Thanks jlb. It’s certainly not a dumb question and I’d be inclined to try that if it were more convenient for me to do so but fundamentally, it seems more or less a moot point given that other applications are able to access the file. I’m kind of hoping that someone with way more Linux system experience than I can easily explain why there would be such a difference. Thanks for the quick reply and suggestion.
Hi,
Can you link to your version control repo , github?
Thanks foss… The repo is on GitLab but it’s set to private. I’m not quite ready to make it public just yet. I can invite you as a guest if you’d like. All I’ll need is your email address (unless of course you’re a member of GitLab already – in which case I’d enter your userid).
Thanks David! I’ve done the invite… Let me know if you need anything else.
As a guest i can only see the project page. I cant see the code itself.
Interesting. AI must’ve lied to me, lol. I changed the role to developer. BTW, I failed to mention in my initial post that the app was originally set up to look for this “userguide.hro” file in the “.hiero” directory beneath the user’s home directory (which gets created on the app’s first run) and I haven’t changed this to reflect the new packaging which will install the app system-wide. So, to test, I’ve been manually creating a symlink to the userguide.hro file (beneath /usr/share) in the “.hiero” directory.
You have a bunch of print debugging statements. What do you see running from a terminal around the time of the permission denied message?
I’m just about to set up to test. I’ll let you know what I find. Thanks!
Okay, I’m now a confirmed idiot of the highest order. All this time I’ve been convinced that I’m only trying to read the file but no, the app is also attempting to write to this location beneath /usr/share (hence “permission denied”)!
Thank you David for making me see what my mind apparently refused to accept!
I’m such an idiot.
I’m such an idiot.
I’m such an idiot.
I’m such an idiot.
…
Let he who has never done anything stupid cast the first stone, @Underdog!
I wanted to ask you if you’ve tried running your application with superuser rights, but I was afraid I’d say something stupid, as I’ve never tried development, or even just BASIC, in a long time…
I’ve also heard that the live session uses a read-only filesystem overlay protection for /usr/share.
You’ve piqued my curiosity: what will your application do once you’ve fixed the problem?
hear hear! I think I did run it as root and it ran fine. Again, def. not a stupid question. Yes /usr/share is apparently set read-only. What confused me is thinking I was only reading, lol. The app is an outliner…
Cool, that’s what I used to do when I was preparing my lesson plans.
Cool back at ya. Most folks aren’t that familiar with single-pane outliners. Before having developed the original Hiero – this is version 2 – I constantly found myself mimicking an outline structure by using a text editor and indenting the text, placing a dash to the left of each “node”, etc. It was horribly inadequate but it was all I had to work with, both on Windows and Linux. Hiero is essentially a “foldable” text editor that also allows formatting. Once I get everything squared away with the app and its repo on GitLab, I’m going to make it public…
such an easy thing to do. Nobody’s perfect. That’s how we learn. We all make mistakes. Glad you found the solution.