[opensuse-packaging] example or documentation related to integrating Systemd in spec files
Hi, Is there an example or documentation related to integrating Systemd in spec files showing how to install and activate service files if system has systemd enabled. Ideally I would like to support both systemd enabled and the traditional init system in the spec. Thanks Togan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 09/14/2011 10:40 AM, Togan Muftuoglu wrote:
Hi,
Is there an example or documentation related to integrating Systemd in spec files showing how to install and activate service files if system has systemd enabled.
Ideally I would like to support both systemd enabled and the traditional init system in the spec.
Before I submit the package to factory I really would like to offer the possibility of including systemd support but with no documentation or sample how can I do that :( Togan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 15/09/11 17:45, Togan Muftuoglu wrote:
On 09/14/2011 10:40 AM, Togan Muftuoglu wrote:
Hi,
Is there an example or documentation related to integrating Systemd in spec files showing how to install and activate service files if system has systemd enabled.
Ideally I would like to support both systemd enabled and the traditional init system in the spec. Before I submit the package to factory I really would like to offer the possibility of including systemd support but with no documentation or sample how can I do that :(
Togan
There were a few threads here earlier, they should still be current http://lists.opensuse.org/opensuse-packaging/2011-06/msg00079.html Regards, Tejas -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 09/15/2011 09:01 PM, Tejas Guruswamy wrote:
On 09/14/2011 10:40 AM, Togan Muftuoglu wrote:
Hi,
Is there an example or documentation related to integrating Systemd in spec files showing how to install and activate service files if system has systemd enabled.
There were a few threads here earlier, they should still be current http://lists.opensuse.org/opensuse-packaging/2011-06/msg00079.html
Thanks but the thread does not come to a conclusion if there are macros to be used or not and if there are what are they at the moment Togan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le vendredi 16 septembre 2011 à 11:57 +0200, Togan Muftuoglu a écrit :
On 09/15/2011 09:01 PM, Tejas Guruswamy wrote:
On 09/14/2011 10:40 AM, Togan Muftuoglu wrote:
Hi,
Is there an example or documentation related to integrating Systemd in spec files showing how to install and activate service files if system has systemd enabled.
There were a few threads here earlier, they should still be current http://lists.opensuse.org/opensuse-packaging/2011-06/msg00079.html
Thanks but the thread does not come to a conclusion if there are macros to be used or not and if there are what are they at the moment
There are macros and I haven't yet written the documentation because some are still in flux and systemd preset handling isn't done yet. Look at acpid package for a good example (but the *migration* macros will disappear soon). -- 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
Hi Frederic, On 09/16/2011 01:39 PM, Frederic Crozat wrote:
There are macros and I haven't yet written the documentation because some are still in flux and systemd preset handling isn't done yet.
Look at acpid package for a good example (but the *migration* macros will disappear soon).
Thanks, I have also had a a look at systemd package and found the systemd macros with explanation. Now since I am at the latest stage to push the package to factory, what how does one do the migration phase according to the macros I have found in "systemd" package # when migrating a package from sysvinit to systemd : %triggerun -- package_name < version_where_switch_occured %service_migrate_to_systemd [ -l run_level ] service_name.service But in the acpid example it is only the service_migrate_to_systemd %pre %service_migrate_to_systemd_pre acpid Also in other parts %postun %restart_on_update acpid %{insserv_cleanup} %service_migrate_to_systemd_postun acpid %service_del_postun acpid.service so if I have a code like below as I am maintaining the package for 11.3 11.4 and Factory am I on the right track ? %postun init %if 0%{?suse_version}>1140 %service_del_postun %name-init.service %else %restart_on_update %name-init %insserv_cleanup %stop_on_removal %endif %if 0%{?suse_version}>1140 %triggerun -- shorewall-init < 4.4.23.2 %service_migrate_to_systemd shorewall-init.service %endif Thanks Togan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le vendredi 16 septembre 2011 à 14:18 +0200, Togan Muftuoglu a écrit :
Hi Frederic,
On 09/16/2011 01:39 PM, Frederic Crozat wrote:
There are macros and I haven't yet written the documentation because some are still in flux and systemd preset handling isn't done yet.
Look at acpid package for a good example (but the *migration* macros will disappear soon).
Thanks, I have also had a a look at systemd package and found the systemd macros with explanation.
Now since I am at the latest stage to push the package to factory, what how does one do the migration phase
according to the macros I have found in "systemd" package
# when migrating a package from sysvinit to systemd : %triggerun -- package_name < version_where_switch_occured %service_migrate_to_systemd [ -l run_level ] service_name.service
But in the acpid example it is only the service_migrate_to_systemd
%pre %service_migrate_to_systemd_pre acpid
Also in other parts
%postun %restart_on_update acpid %{insserv_cleanup} %service_migrate_to_systemd_postun acpid %service_del_postun acpid.service
so if I have a code like below as I am maintaining the package for 11.3 11.4 and Factory am I on the right track ?
Yes, you are :) As I said, the migration macros will be merged into the service_add/service_del macros soon. Triggers should not be used for migration (it was in initial proposal, I've changed this), acpid specfile is right. Another thing you want, if you build your package for 11.4 or before : %if 0%{suse_version} <= 1140 %define systemd_requires %{nil} %endif -- 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
On 09/16/2011 02:30 PM, Frederic Crozat wrote:
As I said, the migration macros will be merged into the service_add/service_del macros soon.
Triggers should not be used for migration (it was in initial proposal, I've changed this), acpid specfile is right.
So I can safely remove the %trigerun and I am still safe with the migration even now
Another thing you want, if you build your package for 11.4 or before : %if 0%{suse_version} <= 1140 %define systemd_requires %{nil} %endif
Yes I have sorted this part already ;) Thanks Togan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Le vendredi 16 septembre 2011 à 14:40 +0200, Togan Muftuoglu a écrit :
On 09/16/2011 02:30 PM, Frederic Crozat wrote:
As I said, the migration macros will be merged into the service_add/service_del macros soon.
Triggers should not be used for migration (it was in initial proposal, I've changed this), acpid specfile is right.
So I can safely remove the %trigerun and I am still safe with the migration even now
Yes, use the %service_migrate_* macros or just wait until I announce the "final" version of the macros to handle migration ;) -- 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 (3)
-
Frederic Crozat
-
Tejas Guruswamy
-
Togan Muftuoglu