I develop an application that has backends (user daily daemons and punctual scripts written in c++ and python) and frontends (Qt GUIs and other clis).
I am looking for filesystem conventions and happy to stick to Fedora only solution.
my rpms would always be installed (ie the files contained in them ) as root? what permissions?
where? presumably out of the “regular” tree (LFS standard)… /opt or /usr/local, how do I choose?
the processes will run with a particular unix user. any link between that and the owner of the files in rpms?
i generate the rpms from cmake
I’ve gone as far as simply preparing the .rpm files and then sending them to the various hosts I want them installed on (all Fedora)… I install with dnf. … I’m not yet interested in using a repo.
In the future, I would.
1 - Usually all the files are installed as root because RPMs generally only write to the root fs and it requires root to invoke the installation of an RPM(either with rpm or dnf). The permissions depend on your specific RPM and how the spec is configured to install the files, generally this is handed by install -m 000 command where 000 can be modified to fit whatever permissions you like(executables and directories usually get 755 and other files such as configurations usually get 644), this command is usually called inside a makefile, inside a spec file, or by a macro inside a spec file.
2 - You can do whatever you like. However, if you’d like to follow some filesystem conventions, then it’s best to install executables to /usr/bin because it’s being installed by an RPM and is thus being managed by a package manager(the rpm package manager if you install from a local file or dnf if you decide to upload and download from a repository). /usr/local is intended for files and executables that are exclusive to your local system and not managed by a package manager, maybe if you wrote a little bash script for yourself then /usr/local/bin would be a “correct” place to put it. /opt is intended for software that you compiled locally, like if you downloaded Firefox’s source code and compiled it then /opt would be a place to put it.
3 - The processes will generally run with the permissions of the user rather than the permissions of the owner of the executable(almost always root).