Hi Wolfgang, I'm in no way a systemd expert. I'm trying to answer your questions with what I know. This might be incomplete or partially wrong, if someone finds an error, please correct me. On 20.11.2011 22:32, Wolfgang Rosenauer wrote:
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.
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. And obviously if there is a native file, it overrides the SysV init script: susi:~ # systemctl status syslog.service syslog.service - System Logging Service Loaded: loaded (/lib/systemd/system/syslog.service; enabled) [...] susi:~ # l /etc/init.d/syslog -rwxr-xr-- 1 root root 6197 Nov 11 12:28 /etc/init.d/syslog*
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?
Check the NetworkManager-wait-online.service, it does exactly that: susi:~ # cat /lib/systemd/system/NetworkManager-wait-online.service [Unit] Description=Network Manager Wait Online Requisite=NetworkManager.service After=NetworkManager.service Wants=network.target Before=network.target [Service] Type=oneshot Environment=NM_ONLINE_TIMEOUT=30 EnvironmentFile=-/etc/sysconfig/network/config ExecStart=/usr/bin/nm-online -q --timeout=${NM_ONLINE_TIMEOUT} [Install] WantedBy=network.target
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?)
I don't know this one, there was something discussed about the package "systemd-branding" which defines which services to start by default etc, but I don't know if this will apply here.
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?
I think that your package should be able to supply its own socket file. Udev does it, too: susi:~ # rpm -qf /lib/systemd/system/udev-kernel.socket udev-173-6.1.x86_64 Hope this helps, seife -- Stefan Seyfried "Dispatch war rocket Ajax to bring back his body!" -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org