Le mardi 21 juin 2011 à 13:42 +0200, Christian Boltz a écrit :
Hello,
on Montag, 20. Juni 2011, Andreas Jaeger wrote:
On Monday, June 20, 2011 15:56:37 Frederic Crozat wrote:
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
I assume there are more distributions that haven't migrated to systemd completely - why not make these calls (optional) part of the proposal?
Well, I would expect each "distro adapted" macros to land in rpm-build (or a package pulled by rpm-build) as we don't really to handle all the other distros macros into our own distro. What I could do is some <insert your custom distro service handling macro here> template in the proposal.
Let's add some examples. Please check whether the following is right for service demo.service:
# XXX: systemd-units is the name on Fedora, should we use the same? # This is for /bin/systemctl Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units
This is crying for a %systemd_requires macro ;-) (if possible, it should be defined in a base package so that we don't need an additional "BuildRequires" to have the macro available - perl-macros / %{perl_requires} can serve as bad example regarding this detail)
Indeed ;) %systemd_requires Requires(post): systemd-units \ Requires(preun): systemd-units \ Requires(postun): systemd-units (the content of this macro could be distro specific, if other rpm distro don't want to use systemd-units as package name for the one containing systemctl
What I'm missing is the way to update so that the service is only enabled if it was enabled before. Fedora has something like the following in their files:
# Package with native systemd unit file is installed for the first time %triggerun -- ypbind < 3:1.32-9 if /sbin/chkconfig --level 3 ypbind ; then /bin/systemctl --no-reload enable ypbind.service >/dev/null 2>&1 || : fi
This should also be a macro.
Frederic: Especially the fact that there _are_ different runlevels and tools to handle sysvinit is a good reason to have a macro, even if every distro might have to write their own macro
The important point is to have a %service_migrate_to_systemd macro that you can use in the specfile for all distributions and that does the job. In other words: specfile writers should not need to know/care about the technical details behind the macro.
Already answered in reply to AJ ;)
I'll post a new draft here tomorrow, trying to include all the feedback
received.
--
Frederic Crozat