Bug#471060: debhelper: dh_installinit's default behaviour is broken

2008-03-18 Thread Craig Sanders
On Mon, Mar 17, 2008 at 09:22:53PM +0100, Stefan Fritsch wrote:
  dh_installinit's default behaviour should be to not stop daemons,
  but to issue a reload, restart, or force-restart in the .postinst.
 
 JFTR, doing a simple reload on upgrade is _always_ wrong. After an 
 upgrade the new executables must be running, not the old ones. For 
 example, the old executables might still contain security issues.

true.

a restart in the postinst, not reload, is the appropriate action.

 And the current debhelper behaviour is the safer way and should be the 
 default. A daemon crashing because some of its data files no longer 
 fit to the running process can cause much more severe data loss than 
 just some down time. 

that is the appropriate behaviour ONLY for those particular daemons
where that actually happens.

for daemons like bind9 and rsyslog and most others, it is the wrong
behaviour - it maximises downtime, disrupts the entire network (for
named) and causes irreplacable data loss (for rsyslog).

if downtime is unavoidable, then it's unavoidable - nothing can be done
about it, it just has to be accepted. but where it IS avoidable, then it
SHOULD be avoided...and, in either case, downtime should be minimised.



if there are a known set of packages which have this behaviour then
either (a future version of) apt or dpkg could prioritise them (perhaps
via some tag in the control file) so that they and their
dependancies are unpacked and configured before other unprioritised
packages.  

or, even without any explicit support in apt or dpkg, a local sysadmin
could write a shell script to upgrade just those daemon packages first
before doing a full dist-upgrade. or upgrade them manually (which is
what i have to do now for bind9. and squid. and now also for rsyslog).

but that's only possible if it's a relatively small set of known
problematic packages.  it becomes impossible - pointless - if ALL
daemons stop then start later, rather than just restart.

why pointless? because the point is to upgrade and configure those
problematic packages as quickly as possible, to minimise downtime. if
all daemon packages do the wrong thing, then the end result would be no
different to just doing a dist-upgrade.



BTW, most daemon packages don't have lots of data files open. most
just read a config file at startup (or on a HUP signal), and open a
log file or socket. 

one that usually does have many data files open, postfix, restarts in
the postinst...and has done so for many years without problem.



 And a maintainer would have to check on every upload if and for which
 old versions it is safe not to stop the daemon before replacing the
 files. This would doubtless lead to many other bugs.

the maintainer could do it in such a complicated manner, but it's not
necessary.

most such problems occur when a significant new version is released
(e.g. a major version, not just a minor point release). the package
maintainer could stop and then start if the old version was = a
particular version number, or just restart if it wasn't.

a simpler generic method that would works reasonably well is that the
maintainer would just have to know whether there was any risk of their
daemon package having such problems. if there was a risk, then stop in
prerm, start in postinst. otherwise, just restart in the postinst.

in any case, it's only necessary for those daemon packages where there
IS such a problem or risk - it's not at all necessary for most daemon
packages.  a simple restart in the postinst will suffuce.


craig

-- 
craig sanders [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#471060: debhelper: dh_installinit's default behaviour is broken

2008-03-18 Thread Stefan Fritsch
 dh_installinit's default behaviour should be to not stop daemons,
 but to issue a reload, restart, or force-restart in the .postinst.

JFTR, doing a simple reload on upgrade is _always_ wrong. After an 
upgrade the new executables must be running, not the old ones. For 
example, the old executables might still contain security issues.

And the current debhelper behaviour is the safer way and should be the 
default. A daemon crashing because some of its data files no longer 
fit to the running process can cause much more severe data loss than 
just some down time. And a maintainer would have to check on every 
upload if and for which old versions it is safe not to stop the 
daemon before replacing the files. This would doubtless lead to many 
other bugs.

Cheers,
Stefan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#471060: debhelper: dh_installinit's default behaviour is broken

2008-03-15 Thread Craig Sanders
Package: debhelper
Version: 6.0.8
Severity: critical
Justification: causes serious data loss


dh_installinit adds code to a package's .prerm script to stop the daemon
at the beginning of the upgrade, and then adds code to restart it in the
.postinst script.

this results in important system daemons (including bind9 and rsyslog)
being stopped for the entire duration of the upgrade - which could be a
very long time in a dist-upgrade.

in the case of bind9, that means no DNS for the entire network it
is serving, which effectively breaks most network activity for that
network.

in the case of rsyslog, that means no logging for the host and for any
other hosts/devices which use it as a syslog host - causing serious loss
of irreplacable data.

in the case of other daemons, whatever service they are providing 
is shut down for the duration of the upgrade.


dh_installinit's default behaviour should be to not stop daemons,
but to issue a reload, restart, or force-restart in the .postinst.

better yet, have no default and force the package maintainer using
dh_installinit to use their brains and their knowledge of their package
to decide which is the most appropriate behaviour for their particular
daemon. exit with an error message if dh_installinit is used without
specifying stop  reload/restart behaviour for prerm and postinst.



see bug numbers 453765 (bind) and 471051 (rsyslog) for more info.



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages debhelper depends on:
ii  binutils2.18.1~cvs20080103-1 The GNU assembler, linker and bina
ii  dpkg-dev1.14.16.6package building tools for Debian
ii  file4.23-2   Determines file type using magic
ii  html2text   1.3.2a-3 An advanced HTML to text converter
ii  man-db  2.5.1-3  on-line manual pager
ii  perl5.8.8-12 Larry Wall's Practical Extraction 
ii  po-debconf  1.0.12.1 manage translated Debconf template

debhelper recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]