Le dimanche 20 novembre 2011 à 22:32 +0100, Wolfgang Rosenauer a écrit :
Hi,
I might have missed important systemd information during the 12.1 development phase but haven't had to deal with it for my packages up to now. A recent package update now introduced systemd services and I found it's not obvious to me what to do. It already starts with trivial questions where I have an my own understanding but not absolutely sure.
First things first, you should read : http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines
The package provides an init script currently and now added systemd service files. So the following questions came to my mind:
Do I still package the sysvinit files? I guess that's a yes because we still offer the sysvinit boot process.
Yes, unless you don't want to drop sysvinit support :)
The package has a sysconfig file which only takes a variable to modify the daemon options. Can I use that for systemd as well? How to do that?
You can, but it depends how the variable was used. It is was just appending the parameters to the daemon, using variable content, you can do use something like EnvironmentFile=-/etc/sysconfig/foobar (- is to make sure /etc/sysconfig/foobar missing won't cause an issue) ExecStart=/bin/foobar ${MY_PARAMS} where /etc/sysconfig/foobar contains things like : MY_PARAMS=-f foo -b ...
The daemon is currently started by default when installed. What happens after the update to the new version which includes systemd files? Will it be enabled by default? (I've actually tried the update and the service was running afterwards so I guess it will be enabled in update case but not for a fresh installation?)
No it won't be enabled by default. If you really want that, you need to open a sr against systemd-presets-branding-openSUSE (see http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines#Enabling_servic... )
For the service it makes a lot of sense to use systemd's socket activation feature. So what do I need to do exactly to have the service disabled but have the socket enabled to start the service automatically (in terms of system configuration)? Is the only way to have services/sockets enabled by default to modify some certain systemd package and not from within a package installation? This sounds strange and rather unfortunate so it's for example not possible to install/update a package which then starts a service by default w/o updating an official central distribution package?
You should be able to use the same mecanism for socket than for .service (and yes, you should not enable .service if you want on-demand activation, see http://0pointer.de/blog/projects/socket-activation.html ) -- Frederic Crozat <fcrozat@suse.com> SUSE -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org