Mailinglist Archive: opensuse-packaging (76 mails)

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

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

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

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

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?


To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >