Mailinglist Archive: opensuse-packaging (76 mails)

< Previous Next >
[opensuse-packaging] Problems configuring systemd services in package scripts
Hi!

I'm having trouble with systemd services that are supposed to be configured on
package update.

In particular, I want one service of the previous package version to be stopped
and removed and a new service that is being shipped with the new package version
to be installed and started.

The package in question is google-compute-engine and the affected services are
google-ip-forwarding-daemon (to be stopped and removed) google-network-daemon
(to be installed and started).

I have been following the packaging guidelines from [1] and added the services
in question to %pre/post and %preun/postun. However, when installing the new
package version over the old one, google-ip-forwarding-daemon gets disabled
but not stopped and google-network-daemon is enabled but not started. Hence,
a reboot is necessary to make the desired changes effective.

I have tried adding "-f" to %service_del_preun and %service_del_preun but that
didn't help. Analyzing the RPM scripts with "rpm --scripts -qf <RPM file>"
showed
that the postinstall script uses "systemctl preset ..." which explains why the
services are enabled but not started.

Looking at the generated scripts for preuninstall and postuninstall, it seems
the case of stopping and removing a service upon upgrade does not seem to
be covered. The generated script contains "systemctl try-restart ...".

Does anyone have a suggestion what the correct way is to achieve the service
changes I have mentioned above? The spec file can be found in [2].

Thanks,
Adrian

[1]
https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines#Register_systemd_unit_files_in_install_scripts
[2]
https://build.opensuse.org/package/view_file/Cloud:Tools/google-compute-engine/google-compute-engine.spec?expand=1
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages