On Mon, 20 Jun 2011 15:56, Frederic Crozat
Le vendredi 17 juin 2011 à 10:38 +0200, Frederic Crozat a écrit :
Le jeudi 16 juin 2011 à 13:48 +0200, Andreas Jaeger a écrit :
On Thursday, June 16, 2011 11:51:29 AM Pavol Rusnak wrote:
On 16/06/11 09:28, Vincent Untz wrote:
Le mercredi 15 juin 2011, à 18:57 +0200, Frederic Crozat a écrit :
However, I'm not sure we should directly add those direct call to systemctl in %post but instead, use some macros, similar to the one we have for sysvinit and / or update those macros to be systemd compliant : %stop_on_removal / %insserv_force_if_yast / %{fillup_only} / % restart_on_update / etc..
+1 for macros. I don't think it's worth trying to update the macros; adding new ones should work well enough -- especially as there's a new file to package anyway, so people will notice there's something to do.
Please, this is an opportunity to unify services packaging across all RPM distros. Please, don't screw up by introducing any new SUSE specific macros. We can talk with Fedora and Mageia at least to come up with one solution that is OK with everyone and has the highest chance of being adopted in upstream RPM.
I agree.
So, let's discuss on the systemd mailing list and propose something there - or what's the best way?
I sent a RFC on systemd-devel mailing list yesterday, we'll see how people react.
Reaction was positive.
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
%service_del_preun() if [ "$1" -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable %{1}.service > /dev/null 2>&1 || : /bin/systemctl stop %{1}.service > /dev/null 2>&1 || : fi
%service_del_postun() /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ "$1" -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart %{1}.service >/dev/null 2>&1 || : fi
Comments welcome
Added Idea esp. for Distros which use their own macros: Would it be possible to provide these macros system/distro independent? As smallest common denominator? The individual distros could implement / modify their special marcos around these basics. This would make distro-independent source-rpm possible, or at least bring them a step nearer. Another step that could be possible to go now would be a database/wiki with the distro-dependent differences. Maybe even a "MASTER"-template spec-file which included all the main rpm consumers in conditional statements? --- Well, a dev can dream, or not? Yamaban.