On Wednesday 12 February 2014 14:59:02 Johannes Meixner wrote:
Hello,
I would like to know how to correctly deregister services in RPM package install scripts.
https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines only talks about "Register services in install scripts"
Assume an older version of package "foobar" that provided both foo.service and bar.service as described in https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines is already installed.
Now a newer version of "foobar" does no longer provide bar.service (but foo.service is still provided).
I hope this is not related to cups.socket?
What is the correct way in foobar.spec to deregister bar.service when updating the package "foobar"?
I would like to use something like --------------------------------------------------- %pre %service_add_pre foo.service %service_del_pre bar.service
%post %service_add_post foo.service %service_del_post bar.service ---------------------------------------------------
I found "service_del_post" only mentioned in http://lists.opensuse.org/opensuse-packaging/2011-06/msg00160.html
That is a typo. If you read on, the pasted spec file uses %service_del_postun (the 'un' was missing')
but it is not documented at https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines so that I don't know if it really exists and even if it exists I don't know if it would do "the right thing".
rpm --eval %service_del_preun But the macro won't do what you want. It's probably easiest to not call %service_del_postun / %service_del_preun for that service file. Instead invoke the commands of the "uninstall" case directly. Or you could move the service file into it's own package and obsolete it from the base pkg. -- Sascha Peilicke SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org