Hi,

thanks for keeping up the discussion! While I did suggest to file this 
against dpkg initially, after reading this bug I do agree with Guillem 
that src:dpkg is the wrong place to implement this. Dpkg should care 
about .deb files and .deb files only (and whatever is needed around 
this). I therefor propose to reassign this discussion to either 
"general" or "debian-policy" for now.

That said, back to the original topic. I agree with Patrick that we need 
a flexble way to tell "the system" whether we want to start a specific 
service on installation or not. The mentioned policy-rc.d system may 
help here, but is not in the current state of documentation and 
implementation.

As far as I can find (according to [1]), our own documentation mentions 
policy-rc.d only twice: [2] and [3]. Especially it is not mentioned in 
Policy 9.3.3 [7]! The best documentation I could find is on people.d.o 
and in the sysv-rc package: [4], which could make one think this is not 
an official interface and only applies to SysV init (it does not: [8]). 
So the first step to fixing the issue should be promoting parts of [4] 
to the Debian Policy, making policy-rc.d an actual interface definition.

After this is defined, we should have a look at the archive and the 
present mis-implementations of [4]. A quick search reveals three 
"correct" uses: [5] and various "maybe-not-so-correct" (I did not read 
the whole code of the packages) ones: [6]. [ "correct" means here the 
package installs an own policy script using the alternatives system ].

With a policy in place and a policy-conform archive, we then can provide 
a default implementation of the interface to the users (as a 
high-priority alternative inside of pkg:init-system-helpers?) in which 
they can decide whether they do want the default debian policy or 
whether they want all or some services to be skipped during the 
installation. A naïve implementation can be found in __DATA__. With this 
implementation, Patrick will just have to drop an 
/etc/policy-rc.d/<clusterservice> with a content of 
"DEBIAN_NO_START_SERVICES=1" and then his specific service will not be 
started during installation. Neither it will be restarted during 
upgrade, which is the right thing to do in Patrick's setup. Also, this 
should be the real interface Patrick is looking for.

Thanks for reading thus far
o/
Evgeni

[1] https://www.google.com/search?q=policy-rc.d+site%3Adebian.org
[2] https://www.debian.org/doc/manuals/securing-debian-howto/ch3.en.html#s3.5
[3] 
https://www.debian.org/doc/manuals/debian-reference/ch09.en.html#_chroot_system
[4] https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt 
installed on Debian systems as 
/usr/share/doc/sysv-rc/README.policy-rc.d.gz from pkg:sysv-rc
[5] https://codesearch.debian.net/results/install%20%2Fusr%2Fsbin%2Fpolicy-rc.d/
[6] https://codesearch.debian.net/perpackage-results/exit.*policy-rc.d/
[7] https://www.debian.org/doc/debian-policy/ch-opersys.html
[8] 
http://sources.debian.net/src/init-system-helpers/1.24/script/deb-systemd-invoke/#L63

__DATA__
#!/bin/sh

# doc
#  either "echo DEBIAN_NO_START_SERVICES=1 > /etc/policy-rc.d.conf"
#  or "echo DEBIAN_NO_START_SERVICES=1 > /etc/policy-rc.d/$service"
#  or FORCE_NO_START_SERVICES=1 dpkg -i ...

NAME=policy-rc.d
DEBIAN_NO_START_SERVICES=0

# load system settings
[ ! -f /etc/${NAME}.conf ] || source /etc/${NAME}.conf

# load package specific settings
[ ! -f /etc/${NAME}/$1 ] || source /etc/${NAME}/$1

if [ ${DEBIAN_NO_START_SERVICES} -eq 1 ] && [ -n 
"${DPKG_RUNNING_VERSION}" ]; then
  exit 101
elif [ -n "${FORCE_NO_START_SERVICES}" ]; then
  exit 101
else
  exit 104
fi

-- 
Bruce Schneier can read and understand Perl programs.

Reply via email to