package %post service restart

Elan Ruusamäe glen at pld-linux.org
Sat Feb 19 16:55:20 CET 2011


hi

i have an idea to replace current '%service foo restart' expansion with
'/sbin/service foo restart' from rpm-build-macros

goal is to support restart action from upstart, as it does not really
confirm with /var/lock/subsys/foo lockfiles detecting is service
"running" or "up"

additionally it opens ways to support other init systems, like systemd

simpliest it would be to expand %service as /sbin/service and replace
"restart" action with "try-restart" (perhaps in macro not in .spec), so
the behaviour is the same, if service is running, it is restarted. this
has the downside that message printed "run \"/sbin/service foo start\"
to start foo" is not presented to end user.

this could be workarounded perhaps by adding new custom action (or
option) that emulates this message printing. good side is that it maybe
localized if the gettext messages get translated.

also for migaration time would fallback to current behaviour if it is
found that initscript doesn't support "try-restart" action

altho i haven't tought out other versions, i'd like still hear some
expressions. as the currently described one sounds like way to do it.
i'll start implementing it meanwhile

-- 
glen


More information about the pld-devel-en mailing list