Bug#826214: SysV init scripts using init-d-script are not properly redirected to systemctl

Michael Biebl biebl at debian.org
Fri Jun 3 12:22:29 BST 2016


Package: sysvinit-utils
Version: 2.88dsf-59.4
Severity: important
File: /lib/init/init-d-script

Hi,

a SysV init script based on the new skeleton using
/lib/init/init-d-script is not properly redirected to systemctl when
being run under systemd as PID 1. 
/etc/init.d/apache-htcacheclean from apache2 is an example useing
init-d-script:

# systemctl status apache-htcacheclean.service 
● apache-htcacheclean.service - LSB: Cache cleaner process for Apache2 web server
   Loaded: loaded (/etc/init.d/apache-htcacheclean; generated; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)
# /etc/init.d/apache-htcacheclean start
[ ok ] Starting Apache htcacheclean: apache-htcacheclean.
# systemctl status apache-htcacheclean.service 
● apache-htcacheclean.service - LSB: Cache cleaner process for Apache2 web server
   Loaded: loaded (/etc/init.d/apache-htcacheclean; generated; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

As you can see, the start request is not redirected to systemctl, so the
systemd integration is broken.

I suspect this happens because init-functions is sourced before $1 is
shifted, so the systemd lsb init hook get's the wrong parameters.



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages sysvinit-utils depends on:
ii  init-system-helpers  1.34
ii  libc6                2.22-10
ii  startpar             0.59-3
ii  util-linux           2.28-5

sysvinit-utils recommends no packages.

Versions of packages sysvinit-utils suggests:
pn  bootlogd  <none>
pn  sash      <none>

-- no debconf information

-- debsums errors found:
debsums: changed file /lib/init/init-d-script (from sysvinit-utils package)



More information about the Pkg-systemd-maintainers mailing list