On ti., 2011-11-22 at 14:59 +0100, Wolfgang Rosenauer wrote:
Hi,
Am 22.11.2011 13:58, schrieb Stefan Seyfried:
I know neither. But as I said this makes upgrade in an existing release pretty ugly. Think about tumbleweed or other backports users. That means I cannot create a smooth migration. Unless: Could I just do: systemctl enable pcscd.socket systemctl disable pcscd.service in the %post script?
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:
It does. I was basically wondering how to enable it on upgrades w/o touching base system packages in addition.
Wolfgang
Depending on whether your service should or should not be started/stopped/restarted during package installation, deinstallation or upgrade, a different set of commands may be specified. See systemctl(1) for details. To facilitate upgrades from a package version that shipped only SysV init scripts to a package version that ships both a SysV init script and a native systemd service file, use a fragment like the following: %triggerun -- foobar < 0.47.11-1 if /sbin/chkconfig --level 5 foobar ; then /bin/systemctl --no-reload enable foobar.service foobar.socket
/dev/null 2>&1 || : fi
Where 0.47.11-1 is the first package version that includes the native unit file. This fragment will ensure that the first time the unit file is installed it will be enabled if and only if the SysV init script is enabled, thus making sure that the enable status is not changed. Note that chkconfig is a command specific to Fedora which can be used to check whether a SysV init script is enabled. Other operating systems will have to use different commands here. //Bjørn -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org