Mailinglist Archive: opensuse-packaging (76 mails)

< Previous Next >
[opensuse-packaging] Disabling systemd services in %post for upgrades
Hi!

I am working on updating the google-compute-engine package which needs
to disable two systemd services that have been removed in the upstream
package.

Upstream contains this systemd-specific code to achieve that in %post [1]:

if [ -f /lib/systemd/system/google-ip-forwarding-daemon.service ]; then
systemctl stop --no-block google-ip-forwarding-daemon
systemctl disable google-ip-forwarding-daemon.service
fi

if [ -f /lib/systemd/system/google-network-setup.service ]; then
systemctl stop --no-block google-network-setup
systemctl disable google-network-setup.service
fi

Since we have RPM macros for disabling services on preun and post [2],
namely %service_del_preun and %service_del_postun, I was wondering
whether there is an equivalent that can be used in %post.

Or should I just use systemctl as above but limit the use with
suse_version to > 1140?

Thanks,
Adrian

[1]
https://github.com/GoogleCloudPlatform/compute-image-packages/blob/master/specs/google-compute-engine.spec#L134
[2]
https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines#Register_systemd_unit_files_in_install_scripts
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >