Pkcon issue vs rpm install

I have an rpm package that install a binary file in /usr/bin and then, in post script section of the rpm file, run this binary file to install a systemd service in system. The problem is that now in 5.x SailfishOS (it used to work) the service is not installed when using GUI or pkcon install-local but works without issues when using rpm -i command.
What is the difference between pkcon and rpm? And how to fix it?

1 Like

This construct works fine for Storeman Installer (and was reused for the SailfishOS:Chum GUI Installer), after performing some research, which is also documented in its GitHub repository. You may want to take a look there.

P.S. (rather to @YouAll, than you personally):
Do not use the rpm command for anything else than the rpm -q sub-command!
Do use pkcon for managing RPM packages on your SailfishOS installation, or alternatively zypper after installing it by executing devel-su pkcon install zypper

2 Likes

I do, but it doesn’t work. This is the issue.

So you found these two locations and understood their content and context?

2 Likes

Why not packaging the unit files ?

1 Like

Not yet but I’m aware of timeout and have tested time-based waiting as long as up to 5s for this simple task. I will try forking process approach although I find it an overkill for such job. I believe that there is something wrong with pkcon.
Thank you for a hint.

Not yet

Well, why did you post the following statement, then?

I can assure you, that “it does work”!
Actually, solely double-forking works reliably, if you really believe you have to start an executable file directly from the RPM spec file of the package which installs this executable file.


The bigger question is, why do you believe that you must trigger the execution of a file installed by RPM immediately after it was installed and without any user interaction?
In most cases this is not the best approach, rather a “think’o”.