Olaf Hering wrote:
On Wed, Nov 12, Stanislav Brabec wrote:
There are still ways to force-enable services in packages, even without presets and review.
How many of them are buggy, and should be solved in some other way? For example whenever I disable xen to use my private copy it will be reenabled during the next update of the xen-tools package.
Maybe the concern with doing it that way was that presets do not trigger if the packages are installed (not upgraded) later.
If packages use presets and %service_add_pre/post, then such incorrect behavior does not happen. If preset defines default-on, service is enabled just once on the first installation and never more. If packages do that by systemctl [--force] enable, they not only obey security review, but package maintainers also have to handle upgrade process on their own. And most of them don't do it correctly. Note: %service_add_post works correctly only if the preset is introduced together with the service scriptlets. There are some tricks, how to do it better in other situations: Migration from sysv init files to systemd services (from openldap2.spec): %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 Presets added later than services (from util-linux.spec, works only if the preset is part of the package): %pre %service_add_pre {service}.service if [ $1 -gt 1 ] ; then if ! test -f /usr/lib/systemd/system-preset/{service preset file} ; then echo -n "" >/run/rpm-%{name}-update-{service}.socket-new-in-upgrade fi fi %post %service_add_post {service}.service -- 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