[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#830065: check that init.d script does not alias reload to restart



Package: lintian
Version: 2.5.22ubuntu1
Severity: wishlist

The debian policy (9.3.2) states:

reload
  cause the configuration of the service to be reloaded without actually
  stopping and restarting the service

However I feel that a lot of packages have init scripts which contain something
like:

  case "$1" in
  reload|restart)
    stop_service
    start_service
    ;;
  
Disobeying this rule in the SysV-init days was harmless. But it turns
out that systemd is more strict. It makes sure that after
"/etc/init.d/something reload" exits, no processes spawned by it remain
alive. I just plain kills them off with a SIGKILL (see log below).

This behaviour is not very well documented, and it took me a while to track
down the cause of the service disappearing (systemtap is awesome).
It would be nice if lintian caught this early, even if a simple regex check
would not be 100% accurate.


lip 05 08:50:25 piec systemd[3179]: Executing: /etc/init.d/knockd reload
lip 05 08:50:25 piec knockd[3179]: Stopping Port-knock daemon: knockd.
lip 05 08:50:26 piec knockd[3184]: starting up, listening on eth0
lip 05 08:50:26 piec knockd[3179]: Starting Port-knock daemon: knockd.
lip 05 08:50:31 piec systemd[1]: Received SIGCHLD from PID 3179 (knockd).
lip 05 08:50:31 piec systemd[1]: Child 3179 (knockd) died (code=exited, status=0/SUCCESS)   <--- init script exits
lip 05 08:50:31 piec systemd[1]: Child 3179 belongs to knockd.service
lip 05 08:50:31 piec systemd[1]: knockd.service: control process exited, code=exited status=0
lip 05 08:50:31 piec systemd[1]: knockd.service got final SIGCHLD for state reload
lip 05 08:50:31 piec systemd[1]: knockd.service changed reload -> running
lip 05 08:50:31 piec systemd[1]: Job knockd.service/reload finished, result=done
lip 05 08:50:31 piec systemd[1]: Reloaded LSB: port-knock daemon.
lip 05 08:50:31 piec systemd[1]: Got disconnect on private connection.
lip 05 08:50:31 piec systemd[1]: Received SIGCHLD from PID 3184 (knockd).
lip 05 08:50:31 piec systemd[1]: Child 3184 (knockd) died (code=killed, status=9/KILL)    <--- service killed off
lip 05 08:50:31 piec systemd[1]: Child 3184 belongs to knockd.service
lip 05 08:50:31 piec systemd[1]: knockd.service: cgroup is empty
lip 05 08:50:31 piec systemd[1]: knockd.service changed running -> exited





-- System Information:
Debian Release: jessie/sid
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.0-35-generic (SMP w/4 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: upstart (via init_is_upstart())

Versions of packages lintian depends on:
ii  binutils                       2.24-5ubuntu14.1
ii  bzip2                          1.0.6-5
ii  diffstat                       1.58-1
ii  file                           1:5.14-2ubuntu3.3
ii  gettext                        0.18.3.1-1ubuntu3
ii  hardening-includes             2.5ubuntu2.1
ii  intltool-debian                0.35.0+20060710.1
ii  libapt-pkg-perl                0.1.29build1
ii  libarchive-zip-perl            1.30-7
ii  libclass-accessor-perl         0.34-1
ii  libclone-perl                  0.36-1
ii  libdpkg-perl                   1.17.5ubuntu5.6
ii  libemail-valid-perl            1.192-1
ii  libfile-basedir-perl           0.03-1fakesync1
ii  libipc-run-perl                0.92-1
ii  liblist-moreutils-perl         0.33-1build3
ii  libparse-debianchangelog-perl  1.2.0-1ubuntu1
ii  libtext-levenshtein-perl       0.06~01-2
ii  libtimedate-perl               2.3000-1
ii  liburi-perl                    1.60-1
ii  man-db                         2.6.7.1-1ubuntu1
ii  patchutils                     0.3.2-3
ii  perl [libdigest-sha-perl]      5.18.2-2ubuntu1.1
ii  t1utils                        1.37-2ubuntu1.1

Versions of packages lintian recommends:
ii  libautodie-perl                 2.23-1
ii  libperlio-gzip-perl             0.18-1build3
ii  perl-modules [libautodie-perl]  5.18.2-2ubuntu1.1

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.17.5ubuntu5.6
ii  libhtml-parser-perl    3.71-1build1
ii  libtext-template-perl  1.46-1
pn  libyaml-perl           <none>
ii  xz-utils               5.1.1alpha+20120614-2ubuntu2

-- no debconf information


Reply to: