Re: stop service ; remove some files ; start service in RPM %postun ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 26 Jan 2013 20:17:14 +0100
Jan-Frode Myklebust <janfrode@xxxxxxxxx> wrote:

> I have an rpm package where I need to stop the running service, remove
> some files and start the service again depending on which package
> version was already installed.

Perhaps %triggerpostun?

http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html

> I assume I need to do this in %postun,
> where we normally do condrestart, but I don't know how to check the
> version of the previously installed package. Could someone help me
> here / does anybody have examples doing something similar ?

You might take a look at the sendmail package, where the scriptlets are
done manually because the systemd version uses two "services" whilst
the sysv version had just the one, so some conversion was needed.

> For sysv-init i guess it should be trivial to check "service $name
> status" to see if it was running, and then stop/start it. But what's
> the equivalent for systemd ?

systemctl try-restart $name

See:
http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet

Paul.
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux