Re: [opensuse-packaging] Packaging policy for systemd .unit file - Proposal
Le mardi 21 juin 2011 à 09:12 +0200, Ludwig Nussel a écrit :
Frederic Crozat wrote:
Le lundi 20 juin 2011 à 17:35 +0200, Frederic Crozat a écrit :
Le lundi 20 juin 2011 à 17:07 +0200, Ludwig Nussel a écrit :
Frederic Crozat wrote:
[...] Here is a proposal I plan to submit upstream if it is fine with people here. I've reused Michael Schröder proposal from FOSDEM 2006, adapted to systemd.
For openSUSE, we could modify slightly this proposal to call % fillup_and_insserv / %stop_on_removal / %restart_on_update when package hasn't migrated to systemd (I didn't add this part to systemd proposal, since it is distro specific) and would keep compat for current users of service_add / service_del_preun / service_del_post
(proposed at fosdem 2006) %service_add() if [ "$1" -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi
%service_add_enabled() if [ "$1" -eq 1 ] ; then # Initial installation /bin/systemctl enable %{1}.service >/dev/null 2>&1 || : fi
There are some packages that directly package the symlink in e.g. multi-user.target.wants. I suppose that shouldn't be done in favor of the macro then?
Good question. I guess this should be discussed with upstream folks.
I can see one big issue, mostly in migration : systemctl enable (or disable) only works if systemd is running. So, if you are installing a package which tries to enable a .service and if systemd isn't running (old init or upgrade for 11.4), systemctl won't do anything :(
"systemctl enable" could simply be replaced with a "ln -s" call I suppose. OTOH the package could just as well simply include the symlink in %files then.
Yes, both are possible (and using "ln -s" is probably better since it will work on an upgrade). Adding to %files will ensure removing the link will be detected by rpm -V. Probably worth discussing with upstream. -- Frederic Crozat <fcrozat@suse.com> SUSE -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (1)
-
Frederic Crozat