Subject: lintian: Please check for update-rc.d "start" and "stop" argument usage

From: Roger Leigh <[email-masked]>
Date: Mon, 22 Jul 2013 21:09:42 +0100

Package: lintian
Version: 2.5.14
Severity: normal

Hi,

As you're undoubtedly aware, we've been using LSB headers in place of
static sequence numbers for a good couple of releases now.  With
wheezy, we migrated completely away from static ordering to dynamic
ordering.  This means that the "start nn n n" and "stop nn n n"
parameters are now essentially pointless--update-rc.d has long
ignored them when dependency-based boot was in use.  For wheezy in
practice it will always ignore them since dependency-based boot is
required.  In jessie we removed start and stop entirely; they still
exist internally, but are just aliases for "defaults", and issue a
warning if used; all runlevel information is obtained from the LSB
headers.

It would be really great if lintian could check for and warn if the
a package calls update-rc.d in its maintainer scripts with "start"
or "stop" arguments.  Likewise for dh_installinit which passes
start and stop arguments to update-rc.d.

Regular expressions which could be used:

  update-rc.d.*[[:space:]]start[[:space:]]
  update-rc.d.*[[:space:]]stop[[:space:]]

  example packages: rsync, nfs-common

This doesn't handle quoting of start or stop in the scripts, but I've
not seen any in practice on my system.

And in debian/rules:

  dh_installinit.*--.*[[:space:]]start[[:space:]]
  dh_installinit.*--.*[[:space:]]start[[:space:]]

  example package: cron rpcbind

I can provide some explanatory text if needed.  Essentially, the
update-rc.d "start" and "stop" arguments are obsoleted and replaced by
the "defaults" argument.  It is no longer possible to specify start
and stop runlevel and sequence numbers; these must be provided by the
LSB header of every init script.  If start and/or stop arguments are
provided, these now act as if "defaults" had been used instead, and
the extra runlevel and sequence information is discarded, and a
warning will be issued.

If there are checks for LSB init script headers, and it's not already
a hard requirement to provide an LSB header, this is a fatal error,
since update-rc.d requires all scripts to have a header.

Many thanks,
Roger

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (550, 'unstable'), (400, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.8-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lintian depends on:
ii  binutils                       2.23.52.20130620-1
ii  bzip2                          1.0.6-4
ii  diffstat                       1.55-3
ii  file                           1:5.14-2
ii  gettext                        0.18.3-1
ii  hardening-includes             2.3
ii  intltool-debian                0.35.0+20060710.1
ii  libapt-pkg-perl                0.1.29
ii  libarchive-zip-perl            1.30-7
ii  libclass-accessor-perl         0.34-1
ii  libclone-perl                  0.34-1
ii  libdigest-sha-perl             5.85-1
ii  libdpkg-perl                   1.16.10
ii  libemail-valid-perl            0.190-1
ii  libfile-basedir-perl           0.03-1
ii  libipc-run-perl                0.92-1
ii  liblist-moreutils-perl         0.33-1+b1
ii  libparse-debianchangelog-perl  1.2.0-1
ii  libtext-levenshtein-perl       0.06~01-2
ii  libtimedate-perl               1.2000-1
ii  liburi-perl                    1.60-1
ii  man-db                         2.6.5-2
ii  patchutils                     0.3.2-2
ii  perl [libdigest-sha-perl]      5.14.2-21
ii  t1utils                        1.37-2

Versions of packages lintian recommends:
ii  libautodie-perl                 2.20-1
ii  libperlio-gzip-perl             0.18-1+b2
ii  perl-modules [libautodie-perl]  5.14.2-21

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.16.10
ii  libhtml-parser-perl    3.71-1
ii  libtext-template-perl  1.45-2
ii  xz-utils               5.1.1alpha+20120614-2

-- no debconf information