Guido Berhoerster wrote:
* Andrei Borzenkov <arvidjaar@gmail.com> [2014-11-20 12:25]:
On Thu, Nov 20, 2014 at 1:38 PM, Guido Berhoerster <gber@opensuse.org> wrote:
* Ludwig Nussel <ludwig.nussel@suse.de> [2014-11-20 11:20]:
Stanislav Brabec schrieb:
Ludwig Nussel wrote:
Is it really worth the effort? We are talking about an optional package here. So if the admin installed the package but did not enable it's services it could be assumed that this is intentional. So even if the default policy for the package changed to enable a service by default now that doesn't mean it needs to enforce that on update.
Optional packages should be working properly out of the box. If the service is socket activated, its running needs no configuration, and it's secure to turn it on, we should do setup on packaging level. Especially if admin already enabled them, update should not break it. I think that these cases should be handled by packagers, not macro authors.
What about packages which provided boot.* sysvinit scripts before, which are after conversion off by default? That seems wrong and unexpected to me and I'd like what I should do in that case. Concrete example: https://build.opensuse.org/request/show/262369
I expect per/post macros to handle this properly (i.e. service replacing initscript must be left in the same state as initscript). If not, it sounds like a bug to me.
I'm happy to fix it if someone tells me how that should be handled, https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines says nothing about it. IMO former boot.* scripts should always be enabled by default, hence my question above.
There are two tips how to handle special cases: Preset introduced later than the service, and you need one time preset: %pre ... if [ $1 -gt 1 ] ; then if ! {test if preset exists in file or branding file} ; then echo -n "" >/run/rpm-%{name}-update-{service name}-new-in-upgrade fi fi (Exact look of the check depends on the result of this discussion. If there will be decision to move all presets to the branding file, script should be modified.) Used in: util-linux/uuidd, pcsc-lite/pcscd Keeping service state during migration from sysv style init scripts: %pre if /usr/bin/chkconfig {initscript} 2>&1 | grep -q on; then touch /run/enable_{service}_service fi %service_add_pre {service}.service %post %service_add_post {service}.service if [ -f /run/enable_{service}_service ]; then /usr/bin/systemctl --quiet enable {service} rm /run/enable_{service}_service fi Used in: openldap2 -- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz Lihovarská 1060/12 tel: +49 911 7405384547 190 00 Praha 9 fax: +420 284 084 001 Czech Republic http://www.suse.cz/ PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org