parazyd 3 years ago
Signed by untrusted user: parazyd <> GPG Key ID: F0CB28FCF78637DE
47 changed files with 3294 additions and 1781 deletions
  1. +0
  2. +0
  3. +0
  4. +0
  5. +0
  6. +0
  7. +0
  8. +0
  9. +441
  10. +1
  11. +1
  12. +25
  13. +32
  14. +0
  15. +0
  16. +3
  17. +1
  18. +9
  19. +1
  20. +3
  21. +3
  22. +16
  23. +5
  24. +12
  25. +135
  26. +102
  27. +0
  28. +206
  29. +192
  30. +230
  31. +193
  32. +103
  33. +215
  34. +56
  35. +10
  36. +0
  37. +0
  38. +559
  39. +220
  40. +450
  41. +0
  42. +0
  43. +0
  44. +0
  45. +53
  46. +5
  47. +12

+ 0
- 13
autoscripts/postinst-systemd-dont-enable View File

@@ -1,13 +0,0 @@
if deb-systemd-helper debian-installed #UNITFILE#; then
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask #UNITFILE# >/dev/null || true

if deb-systemd-helper --quiet was-enabled #UNITFILE#; then
# Create new symlinks, if any.
deb-systemd-helper enable #UNITFILE# >/dev/null || true

# Update the statefile to add new symlinks (if any), which need to be cleaned
# up on purge. Also remove old symlinks.
deb-systemd-helper update-state #UNITFILE# >/dev/null || true

+ 0
- 13
autoscripts/postinst-systemd-enable View File

@@ -1,13 +0,0 @@
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask #UNITFILE# >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled #UNITFILE#; then
# Enables the unit on first installation, creates new
# symlinks on upgrades if the unit file has changed.
deb-systemd-helper enable #UNITFILE# >/dev/null || true
# Update the statefile to add new symlinks (if any), which need to be
# cleaned up on purge. Also remove old symlinks.
deb-systemd-helper update-state #UNITFILE# >/dev/null || true

+ 0
- 9
autoscripts/postinst-systemd-restart View File

@@ -1,9 +0,0 @@
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
deb-systemd-invoke $_dh_action #UNITFILES# >/dev/null || true

+ 0
- 4
autoscripts/postinst-systemd-start View File

@@ -1,4 +0,0 @@
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
deb-systemd-invoke start #UNITFILES# >/dev/null || true

+ 0
- 12
autoscripts/postrm-systemd View File

@@ -1,12 +0,0 @@
if [ "$1" = "remove" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper mask #UNITFILES# >/dev/null

if [ "$1" = "purge" ]; then
if [ -x "/usr/bin/deb-systemd-helper" ]; then
deb-systemd-helper purge #UNITFILES# >/dev/null
deb-systemd-helper unmask #UNITFILES# >/dev/null

+ 0
- 3
autoscripts/postrm-systemd-reload-only View File

@@ -1,3 +0,0 @@
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true

+ 0
- 3
autoscripts/prerm-systemd View File

@@ -1,3 +0,0 @@
if [ -d /run/systemd/system ]; then
deb-systemd-invoke stop #UNITFILES# >/dev/null

+ 0
- 3
autoscripts/prerm-systemd-restart View File

@@ -1,3 +0,0 @@
if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
deb-systemd-invoke stop #UNITFILES# >/dev/null

+ 441
- 1
debian/changelog View File

@@ -1,5 +1,445 @@
init-system-helpers (1.49) unstable; urgency=low

[ Felipe Sateler ]
* Upload to unstable. Urgency low due to large changeset.
* d-s-invoke: Execute systemctl once when starting units.
This ensures systemd itself can order them the best way it sees fit.
(Closes: #848192)
* update-rc.d: check that /etc/insserv.conf exists before invoking insserv.
It might happen that the binary exists but the configuration file doesn't,
and then the insserv invocation will fail. Therefore don't consider insserv
installed until the configuration file exists.
Thanks to Petter Reinholdtsen for the patch. (Closes: #849284)
* Bump Standards-Version

[ Iain Lane ]
* invoke-rc.d: Pass --full to `systemctl status', so we don't get ellipsised output.

[ Michael Biebl ]
* Drop support for upstart

-- Felipe Sateler <> Mon, 17 Jul 2017 12:27:32 -0400

init-system-helpers (1.48) unstable; urgency=medium

* Team upload
* [fbabdc8] Handle units with escaped characters correctly.
for details. (Closes: #861204)

-- Bernd Zeimetz <> Tue, 02 May 2017 12:20:21 +0200

init-system-helpers (1.47) unstable; urgency=medium

[ Christian Hofstaedtler ]
* Align policy-rc.d existing/nonexisting case for custom actions.
Previously, when calling invoke-rc.d with a "custom" action, it
would print an error when a policy-rc.d file was installed, but
it would be silent if no such file was installed. (Closes: #728682)

[ Andreas Henriksson ]
* Do policy-rc.d automatically in init-less chroots.
See #838966 and #838997 for background.
A debootstrap with --variant=minbase will have lsb-base installed,
so the person running into this issue must have:
- not added a policy-rc.d in his init-less chroot
- removed lsb-base manually (and what else?)
This patch auto-detects the situation with init-less chroot that's
missing a policy-rc.d and deals with it automatically (plus gives
a warning message). (Closes: #843761)

[ Ondřej Nový ]
* Add try-restart action.
See #851688

[ Felipe Sateler ]
* Make init depend on a new enough init-system-helpers.
In jessie, update-rc.d/invoke-rc.d/service are shipped by sysv-rc.
They got moved to init-system-helpers after that, so make sure we
have the new versions to ensure the scripts are available.
This dependency can probably be dropped after stretch is released.
* update-rc.d: allow trailing whitespace in LSB header delimiters.
It is a hard to diagnose condition because trailing spaces are
invisible in most editors. Moreover, all the other parsers (systemd,
insserv) allow such trailing space. (Closes: #851730)

-- Felipe Sateler <> Wed, 18 Jan 2017 10:17:07 -0300

init-system-helpers (1.46) unstable; urgency=medium

* Drop dh-systemd transitional package.
It is now provided by debhelper (Closes: #841914)
* Add a meaningful short description to init metapackage
* Document copyright of things lifted from pkg:sysvinit (Closes: #839545)
* Use https url for copyright format

-- Felipe Sateler <> Sun, 06 Nov 2016 17:02:00 -0300

init-system-helpers (1.45) unstable; urgency=medium

* Revert "invoke-rc.d, service: Asynchronously reload systemd units"
This caused fallout at least in the autopkgtests of two packages, possibly many
more, thus could also break assumptions in more important environments, and was
just a defensive move, not a bug fix.
This reverts commit 9cfb6dfed4a38b7c3d8b7fd04a7681690049e424.

-- Martin Pitt <> Tue, 20 Sep 2016 16:27:43 +0200

init-system-helpers (1.44) unstable; urgency=medium

* invoke-rc.d, service: Check for instead of There is a curious bug which sometimes causes
"systemctl is-active" to say inactive until "show" or
"status" gets called on the unit. This needs to be investigated. Until
then, check for which by and large does the same job,
but seems to work reliably.

-- Martin Pitt <> Mon, 12 Sep 2016 22:52:23 +0200

init-system-helpers (1.43) unstable; urgency=medium

[ Felipe Sateler ]
* Add /etc/rc?.d to the dirs shipped by init-system-helpers.
(Closes: #834524)

[ Martin Pitt ]
* invoke-rc.d, service: Only ignore systemd unit dependencies before "systemctl is-system-running" might still be false in case
of running jobs for device/mount/hotplug/dynamic actions units. But in
those cases we already do want to respect unit dependencies, as the system
is booted up sufficiently to avoid dependency loops. Fixes installation of
packages like PostgreSQL under cloud-init or when manually installing
packages right after booting. (LP: #1576692)
* invoke-rc.d, service: Asynchronously reload systemd units.
Reloading SysV init scripts has never been synchronous, so use --no-block
to reload them under systemd. This is another, and a better, line of
defence against if-up.d hook deadlocks during boot (see

-- Martin Pitt <> Mon, 12 Sep 2016 09:35:28 +0200

init-system-helpers (1.42) unstable; urgency=medium

[ Michael Biebl ]
* init-system-helpers: Include insserv package state when filing a bug.
This makes it easier to figure out if the fallback code in update-rc.d
was used or not.

[ Felipe Sateler ]
* Add myself to uploaders
* update-rc.d: preserve S/K links when insserv is not installed.
If there are any links, preserve them. In fallback mode we don't care
about the number encoded, but we do care about the S/K state. So instead
of trying to renumber back to 01, preserve the actually existing links.
This also fixes a bug that could cause multiple enable links to be
created for a single service. (Closes: #832945)

-- Felipe Sateler <> Sat, 30 Jul 2016 17:04:28 -0400

init-system-helpers (1.41) unstable; urgency=medium

* update-rc.d: Properly handle enable|disable for SysV init scripts if
insserv is not available. (Closes: #832582)

-- Michael Biebl <> Wed, 27 Jul 2016 11:42:54 +0200

init-system-helpers (1.40) unstable; urgency=medium

[ Martin Pitt ]
* update-rc.d: Add fallback if insserv is not available.
If insserv is not available, we are either under systemd or a chroot,
where the rc?.d/ link priorities don't matter, so create the
/etc/rc?.d/[SK]01<name> links with a hardcoded "01" priority.
Drop insserv dependency again.
* invoke-rc.d: Add SysV fallback for "systemctl is-enabled".
Version 1.35 switched to "systemctl is-enabled" to determine if a service
is enabled. This also has worked for SysV init scripts since systemd 220-1
(via the systemd-sysv-install wrapper), but does not yet work under
Jessie's systemd 215. Add a fallback to checking runlevel symlinks (for
any runlevel) to fix upgrades where init-system-helpers gets upgraded
before systemd, and to make i-s-h backportable to Jessie.
(Closes: #830982)

[ Michael Biebl ]
* invoke-rc.d: Drop fallback code for ancient upstart versions.
Even wheezy ships a version >= 0.9.7.
* invoke-rc.d: Only consider the enabled-state for start and restart.
We should not deny other actions, like status, stop or reload on
disabled services.
* invoke-rc.d: Don't check the enabled state twice.
On start|restart we already enforce the local policy and RC will be set
to 101, if the service was disabled.
Also, checking for the output of "systemctl --quiet is-enabled" is
problematic, as it is currently broken for non-native services [1].
So drop it completely.
* invoke-rc.d: Allow restarting disabled-but-running services.
Restart services that are disabled but have been started manually.
A start request for a running service is a nop under systemd, so we
don't need to handle start and restart separately.

-- Michael Biebl <> Tue, 26 Jul 2016 22:44:01 +0200

init-system-helpers (1.39) unstable; urgency=medium

* Add an explicit dependency on insserv. For now we still need insserv in
update-rc.d to properly enable SysV init scripts but we can't rely on
other packages, like sysv-rc, anymore to pull in insserv for us, because
they might not be installed anymore by default.

-- Michael Biebl <> Tue, 12 Jul 2016 22:07:16 +0200

init-system-helpers (1.38) unstable; urgency=medium

* Remove dh_systemd_enable and dh_systemd_start. Those helpers will be
shipped by debhelper (>= 9.20160709) from now on. (Closes: #822670)
* Remove systemd2init and related files as we want to make dh-systemd an
empty, transitional package which we can drop eventually.
* Turn dh-systemd into a transitional package pulling in a recent enough
version of debhelper.

-- Michael Biebl <> Mon, 11 Jul 2016 18:05:58 +0200

init-system-helpers (1.37) unstable; urgency=medium

* Stop setting POD_MAN_DATE. It was added to support reproducible builds
which is no longer necessary now that pod2man suppors SOURCE_DATE_EPOCH
which is automatically set by dh.
* dh_systemd_enable: Do not mask previous declaration of $service variable.
(Closes: #829278)

-- Michael Biebl <> Fri, 08 Jul 2016 17:41:37 +0200

init-system-helpers (1.36) unstable; urgency=medium

[ Martin Pitt ]
* init: Don't depend on sysvinit-core when building on/for Ubuntu and
* init: Drop "essential" from the package description as it is not essential
any more.
* invoke-rc.d: Quiesce error message if "runlevel" does not exist, which is
now the case in chroots since init stopped being essential.
(Closes: #827376)
* update-rc.d: Testing for /etc/init.d/ is not sufficient as
initscripts might only be unpacked but not configured yet (during
debootstrap). Thus test if /etc/rcS.d/S?? exists. Thanks to
Felipe Sateler for the idea! (Closes: #824804)
* init-system-helpers: Ship README.invoke-rc.d and README.policy-rc.d.
* invoke-rc.d.8: Update the SEE ALSO link to README.policy-rc.d.
(Closes: #358496)
* service.8: Document that this starts systemd units as well.
(Closes: #758139)
* invoke-rc.d: Show "systemctl status" on a failed (re)start if running
under systemd. This makes logs with failed package installations much more
useful, and human users will most likely do exactly that anyway.
(LP: #1596056)

[ Luca Boccassi ]
* dh_systemd_enable: Add support for installing templated service units.
(Closes: #770344)
* dh_systemd_enable: Add support for installing path units.
(Closes: #768609)

-- Martin Pitt <> Tue, 28 Jun 2016 22:10:37 +0200

init-system-helpers (1.35) unstable; urgency=medium

* invoke-rc.d: When running under systemd, query systemctl is-enabled
instead of checking for rc?.d/ links. This allows operation without
sysv-rc with packages that ship native systemd units. Packages which only
ship an init.d script continue to need sysv-rc and runlevels, of course.
(Closes: #827191, LP: #1587903)

-- Martin Pitt <> Sat, 18 Jun 2016 19:14:17 +0200

init-system-helpers (1.34) unstable; urgency=medium

[ Martin Pitt ]
* Make "init" not essential any more and lower priority from "required" to
"important", so that we can drop it from minimal chroots and docker
containers at some point. Explicitly mark init-system-helpers as essential
now (before it was only transitively essential due to init depending on
it). (Closes: #756023)
* Mark init "Important: yes" instead, so that one does not accidentally
uninstall it.
* deb-systemd-invoke: Accept policy-rc.d exit code 0 as "allowed" in
addition to code 104, like invoke-rc.d. (Closes: #825075)

[ Dan Nicholson ]
* deb-systemd-helper, dh_systemd_start: Use split rather than
Text::ParseWords::shellwords since the latter will strip valid \
escapes from unit names. The values then need to have leading and
trailing quotes stripped. (Closes: #820359)
* dh_systemd_enable: Drop unused Text::ParseWords use.

-- Martin Pitt <> Mon, 30 May 2016 15:52:48 +0200

init-system-helpers (1.33) unstable; urgency=medium

* Drop SysV reference from init's short package description, as it's not
specific to SysV init at all.
* Revert the check for failing "runlevel" command. In chroots it is always
failing, so just print out the warning and otherwise ignore the failure as
we've done for many years with the broken check. (Closes: #823611)

-- Martin Pitt <> Fri, 06 May 2016 09:44:05 -0500

init-system-helpers (1.32) unstable; urgency=medium

* dh_systemd_{enable,start}: Quiesce "No such file or directory" error
messages when calling on a package without /lib/systemd/system/.
(Closes: #822710)
* invoke-rc.d: Fix check for failing "runlevel" command.
* invoke-rc.d: Under systemd, "runlevel" only switches to 3 or 5 when have been reached, not before.
Adjust the runlevel check accordingly. This is only relevant for the check
for wrong/dangling rcN.d/ symlinks, so just pin it to "5" (the precise
value does not matter much). Fixing this in systemd requires bigger
architectural changes, so use this tiny (and backportable) bandaid for the
time being. (LP: #1575572, see #608456)

-- Martin Pitt <> Thu, 05 May 2016 22:11:26 -0500

init-system-helpers (1.31) unstable; urgency=medium

* Fix FTBFS when building arch specific binaries only.

-- Martin Pitt <> Tue, 26 Apr 2016 17:37:46 +0200

init-system-helpers (1.30) unstable; urgency=medium

[ Felipe Sateler ]
* update-rc.d: Add 'defaults' action to usage message. (Closes: #814666)
* update-rc.d: Do not print 'error:' when passing --help

[ Niels Thykier ]
* dh_systemd_start: Default to -R in compat 10, for consistency with
* dh_systemd_*: Do not needlessly traverse the entire package tree.
* dh_systemd_*: Add DH promise to avoid being called for no reason.
* Update Vcs-* fields to use https.

[ Raphaël Hertzog ]
* tests: Support $TEST_ON_REAL_SYSTEM which skips the tmpfs bind mounts, and
use that in the autopkgtest. This provides a more realistic test and
unbreaks operations which communicate with pid1. Also purge metadata in
between tests.
* Prefer calling "systemctl preset" instead of "enable" when available, so
that systemd.preset(5) files are respected by packages. (Closes: #772555)

[ Martin Pitt ]
* Bump Standards-Version to 3.9.8 (no changes necessary).
* Fix "service --version" to show the currrent instead some old hardcoded
version. (Closes: #819984)
* service.8: Document that $PATH is passed to the init script.
(Closes: #619464)

[ Erik Ziegenbalg ]
* dh-systemd: Support enabling of debian/<package>.mount files.
(Closes: #803774)

[ Luca Boccassi ]
* dh-systemd: Support installing .target files. (Closes: #793153)

-- Martin Pitt <> Tue, 26 Apr 2016 10:01:46 +0200

init-system-helpers (1.29) unstable; urgency=medium

[ Michael Biebl ]
* Bump debhelper compatibility level to 9.

[ Raphael Geissert ]
* invoke-rc.d: Fix behaviour when no start or stop symlink is found.
Although update-rc.d(8) says that it is a common administration error to
delete a start symlink instead of renaming it to make it a stop symlink,
the default behaviour of invoke-rc.d in that case is not sensible, and
leads to the init script being executed. (Closes: #546532)

[ Martin Pitt ]
* invoke-rc.d: Fix package installation failure when installing a package
with an upstart script and systemd unit, but no SysV script in a chroot.
(LP: #1543051)

[ Felipe Sateler ]
* update-rc.d: Ensure insserv doesn't fail if initscripts is not installed
(Closes: #806438)

[ Benda Xu ]
* script/invoke-rc.d: Add OpenRC support.
* script/update-rc.d: Add OpenRC support.

-- Martin Pitt <> Mon, 29 Feb 2016 13:24:34 +0100

init-system-helpers (1.28) unstable; urgency=medium

[ Martin Pitt ]
* invoke-rc.d: Fix actions to run under systemd if there is no init.d
script. (Closes: #747851)
* invoke-rc.d: Don't start systemd units which are disabled. Restart them
only if they were already running (i. e. started manually by the admin).
(Closes: #768450)
* update-rc.d: Support /usr/lib/insserv/insserv location too, as with
newer sysvinit versions.
* Add autopkgtest which runs the tests in t/.
* Drop Michael Stapelberg and Tollef Fog Heen from Uploaders:, they stopped
systemd work long ago. Thanks for your great work in the past!
* Run wrap-and-sort -at over our debian control files.

[ Andreas Henriksson ]
* Add support for -X option. (Closes: #760168)

[ Michael Biebl ]
* invoke-rc.d: Allow stop and status requests for masked systemd services.
(Closes: #717109)

-- Martin Pitt <> Fri, 05 Feb 2016 12:30:53 +0100

init-system-helpers (1.27) unstable; urgency=high

Urgency high to not further delay the sysvinit migration to testing, and to
avoid this going into testing with breaking file-rc.

[ Martin Pitt ]
* Add debian/clean to remove script/*1.p. (Closes: #812586)
* Version the conflict to file-rc, 0.8.17 now works fine with the moved
update-rc.d and invoke-rc.d.

-- Martin Pitt <> Tue, 26 Jan 2016 11:35:49 +0100

init-system-helpers (1.26) unstable; urgency=medium

* Drop upstart as an alternative init dependency, as the package got
* Conflict to current openrc version <= 0.18.3-1, to stop the upgrade before
running into the update-rc.d file conflict. (Closes: #811662)
This assumes that the next openrc upload diverts update-rc.d
(see #811708).

-- Martin Pitt <> Fri, 22 Jan 2016 16:02:24 +0100

init-system-helpers (1.25) unstable; urgency=medium

[ Andreas Henriksson ]
* Import invoke-rc.d + update-rc.d from sysvinit 2.88dsf-59.2
(see #805487)
* Import service from sysvinit 2.88dsf-59.2
* Move service files into non-specific subdirectory
* init-system-helpers: Ship invoke-rc.d, update-rc.d and service
* Only pod2man init-system-helpers script for now
* update-rc.d: drop old fallback path for insserv
* update-rc.d: only use insserv if available
* Raise init-system-helpers Priority to required

[ Martin Pitt ]
* Update i-s-h package description to describe the newly moved tools.
* Make init depend on init-system-helpers, to ensure the availability of
invoke-rc.d and update-rc.d if/once sysvinit-utils becomes non-essential.

-- Martin Pitt <> Mon, 18 Jan 2016 15:13:20 +0100

init-system-helpers (1.24+devuan1.0) unstable; urgency=medium
* Initial Devuanisation.
* Release +devuan1.0

+ 1
- 0
debian/clean View File

@@ -0,0 +1 @@

+ 1
- 1
debian/compat View File

@@ -1 +1 @@

+ 25
- 9
debian/control View File

@@ -2,21 +2,38 @@ Source: init-system-helpers
Section: admin
Priority: extra
Maintainer: Daniel Reurich <>
Build-Depends: debhelper (>= 8.0.0), perl:any
Standards-Version: 3.9.6
Uploaders: Michael Biebl <>,
Martin Pitt <>,
Felipe Sateler <>
Build-Depends: debhelper (>= 9),
Standards-Version: 4.0.0

Package: init-system-helpers
Architecture: all
Priority: required
Essential: yes
Multi-Arch: foreign
Depends: perl-base (>= 5.20.1-3), ${perl:Depends}, ${misc:Depends}
Breaks: systemd (<< 44-12)
Depends: perl-base (>= 5.20.1-3),
Replaces: sysv-rc (<< 2.88dsf-59.3~),
sysvinit-utils (<< 2.88dsf-59.3),
# sysv-rc now pre-depends on us and if we break them we get:
# E: This installation run will require temporarily removing the essential package sysvinit-utils:amd64 due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option.
#Breaks: sysv-rc (<< 2.88dsf-59.3~)
Breaks: systemd (<< 44-12),
sysvinit-utils (<< 2.88dsf-59.3~),
Conflicts: file-rc (<< 0.8.17~),
openrc (<= 0.18.3-1),
Description: helper tools for all init systems
This package contains helper tools that are necessary for switching between
the various init systems that Devuan contains (e.g. sysvinit, upstart).
Maintainers of other init systems are welcome to include their helpers in this package, provided it doesn't try to take over the world.
Maintainers of other init systems are welcome to include their helpers in this
package, provided it doesn't try to take over the world.

Package: dh-systemd
Architecture: all
@@ -32,12 +49,11 @@ Description: [deprecated] debhelper add-on to handle systemd unit files
The dh_systemd_start command deals with start/stop/restart on upgrades for
systemd-only service files.

Package: init
Section: metapackages
Architecture: any
Essential: yes
Priority: required
Priority: important
XB-Important: yes
Multi-Arch: foreign
Pre-Depends: sysvinit-core | upstart [linux-any]
Depends: ${misc:Depends}

+ 32
- 10
debian/copyright View File

@@ -1,22 +1,44 @@

Files: *
Copyright: 2013 Michael Stapelberg
License: BSD-3-clause

Files: systemd2init
Copyright: 2014 Ondřej Surý <>
2014 Lukáš Zapletal <>
License: GPL-3+

Files: debian/*
Copyright: 2013 Michael Stapelberg <>
License: BSD-3-clause

License: GPL-3+
On Debian systems the full text of the GNU General Public
License can be found in the `/usr/share/common-licenses/GPL'
Files: script/service man8/service.8
Copyright: 2006 Red Hat, Inc
2008 Canonical Ltd
License: GPL-2+

Files: script/invoke-rc.d man8/invoke-rc.d.8
Copyright: 2000,2001 Henrique de Moraes Holschuh <>
License: GPL-2+

Files: script/update-rc.d man8/update-rc.d.8
Copyright: 1997-2005 Miquel van Smoorenburg <>
Members of the pkg-sysvinit project
License: GPL-2+

License: GPL-2+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
On Debian systems, the complete text of the GNU General Public License
version 2 can be found in ‘/usr/share/common-licenses/GPL-2’.

License: BSD-3-clause
Copyright © 2013 Michael Stapelberg

+ 0
- 7
debian/dh-systemd.install View File

@@ -1,7 +0,0 @@
script/dh_systemd_start usr/bin
script/dh_systemd_enable usr/bin
autoscripts usr/share/debhelper
lib/Debian/Debhelper/Sequence/ usr/share/perl5/Debian/Debhelper/Sequence/
systemd2init/systemd2init usr/bin
systemd2init/skeleton.debian usr/share/dh-systemd
systemd2init/skeleton.redhat usr/share/dh-systemd

+ 0
- 2
debian/dh-systemd.manpages View File

@@ -1,2 +0,0 @@

+ 3
- 0
debian/gbp.conf View File

@@ -0,0 +1,3 @@
full = True
multimaint-merge = True

+ 1
- 0
debian/init-system-helpers.bug-control View File

@@ -0,0 +1 @@
package-status: insserv

+ 9
- 1
debian/init-system-helpers.dirs View File

@@ -1,2 +1,10 @@

+ 1
- 0
debian/ View File

@@ -0,0 +1 @@

+ 3
- 0
debian/init-system-helpers.install View File

@@ -1,2 +1,5 @@
script/deb-systemd-helper usr/bin
script/deb-systemd-invoke usr/bin
script/invoke-rc.d usr/sbin
script/service usr/sbin
script/update-rc.d usr/sbin

+ 3
- 0
debian/init-system-helpers.manpages View File

@@ -1,2 +1,5 @@

+ 16
- 6
debian/rules View File

@@ -9,9 +9,7 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

BUILD_DATE = $(shell dpkg-parsechangelog -S Date)
POD_MAN_DATE = $(shell date -u +"%Y-%m-%d" --date="$(BUILD_DATE)")
VERSION = $(shell dpkg-parsechangelog -S Version)

dh_perl -d --package=init-system-helpers
@@ -19,9 +17,21 @@ override_dh_perl:

for file in $$(ls script); do \
pod2man --section=1p --utf8 script/$$file script/$$file.1p; \
for file in $$(ls script/deb-* script/dh_*); do \
pod2man --section=1p --utf8 $$file $$file.1p; \

[ ! -d debian/init-system-helpers ] || sed -i 's/__VERSION__/$(VERSION)/' debian/init-system-helpers/usr/sbin/service

if dpkg-vendor --derives-from ubuntu; then \
dh_gencontrol -- -Valt:sysvinit=""; \
else \
dh_gencontrol -- -Valt:sysvinit="| sysvinit-core"; \

dh $@
dh $@

+ 5
- 0
debian/tests/control View File

@@ -0,0 +1,5 @@
Tests: t
Depends: @,
Restrictions: needs-root, breaks-testbed, allow-stderr, isolation-container

+ 12
- 0
debian/tests/t View File

@@ -0,0 +1,12 @@
set -eu

mount --make-rprivate /
cpanm Linux::Clone


for test in t/*.t; do
echo "======== $(basename $test) ======="
perl $test

+ 135
- 0
doc/README.invoke-rc.d View File

@@ -0,0 +1,135 @@

This is the internal documentation for invoke-rc.d, as
written by Henrique M Holschuh <>

This document can be found on the web as well at

There is also the Debian BTS entry for the invoke-rc.d policy change at

INVOKE-RC.D (/usr/sbin/invoke-rc.d) interface:

The interface for all implementations of invoke-rc.d is mandated by the base
implementation in the sysvinit package, just like it is done for

There is a provision for a "local initscript policy layer" (read: a call to
/usr/sbin/policy-rc.d if this executable is present in the local system),
which allows the local system administrator to control the behaviour of
invoke-rc.d for every initscript id and action. It is assumed that this
script is OPTIONAL and will by written and provided by packages other than
the initscript system (sysvinit and file-rc packages).

The basic interface for all implementations of policy-rc.d is mandated by
the requirements of the base implementation of invoke-rc.d. This interface
will be described either in the manpage of invoke-rc.d, and in a text file
stored in /usr/share/doc/sysvinit/ by package sysvinit (which will host the
base implementation of invoke-rc.d).

Proposed script interfaces:

invoke-rc.d [options] <basename> <action> [extra initscript parameters...]

basename - Initscript ID, as per update-rc.d(8)
action - Initscript action. Known actions are:
start, [force-]stop, [try-]restart,
[force-]reload, status
(status is there because of the LSB. Debian does not use it).

extra initscript parameters: These parameters are passed to the initscript
as is, after the action parameter. <action> is always the first paramenter
to the initscript, and may be modified by fallback actions or policy-rc.d
requests. Note, however, that the extra parameters are not dropped or
modified even if the action (first parameter) is modified.


Quiet mode, no error messages are generated by invoke-rc.d; policy-rc.d
is also called with --quiet if this option is in effect.

Try to run init script regardless of policy and non-fatal errors. Use
of this option in automated scripts is severely discouraged as it
bypasses integrity checks. If the initscript cannot be executed, error
status 102 is returned. Do note that the policy layer call
(policy-rc.d) is NOT skipped, although its results are ignored.

Try to run the initscript even if a non-fatal subsystem error is
detected (e.g: bad rc.d symlinks). A 102 status exit code will result
if init script fails to execute anyway). Unlike --force, policy is
still enforced with --try-anyway.

Return status code 101 instead of status code 0 if initscript action is
denied by local policy rules or runlevel constrains. An warning is
generated if the action is denied.

Returns one of status codes 100-106, does not execute the init.d
script. Implies --disclose-deny and --nofallback. Status codes 104-106
are only generated by this option.

Note many messages are still sent to stderr in --query mode, including
those regarding policy overrides and subsystem errors. Use --quiet if
silent --query operation is desired.

The policy layer (policy-rc.d) may return fallback actions to be run
instead of the requested action. If this option is active, a fallback
action request will be ignored and a "action not allowed" reply used in
its place. This is probably a BAD idea unless you know exactly what
you're doing.

Outputs help message to stdout

Unknown actions may generate warnings, but are passed to the underlying
initscript anyway. The reason for the warning is simple: It is very unlikely
that an unknown action (by invoke-rc.d) will be known to the policy layer
(policy-rc.d), and therefore it may cause an initscript to execute an action
which the local system administrator would have not allowed had he known
about it. If policy-rc.d is not present, no warnings for unknown actions
are generated.

Should an initscript be executed, invoke-rc.d ALWAYS returns the status code
returned by the initscript. Initscripts should not return status codes in
the 100+ range (this is also a LSB requirement).

Exit status codes (LSB compatible):
0 : success
either the init script was run and returned exit status 0 (note
that a fallback action may have been run instead of the one given
in the command line), or it was not run because of runlevel/local
policy constrains and --disclose-deny is not in effect.
1 - 99 : reserved for init.d script
100 : init script ID (basename) unknown
init script not registered sucessfully through
update-rc.d or init script does not exist.
This error is fatal for most initscript systems.
101 : action not allowed
requested action will not be performed because of
runlevel or local policy constrains, and
--disclose-deny is in effect. Note that a fallback
action is NOT considered "action not allowed",
unless --nofalback is in effect.
102 : subsystem error
initscript (or policy) subsystem malfuncion.
(e.g. broken /sbin/runlevel).
Also, forced initscript execution due to
--try-anyway or --force failed.
103 : syntax error
104 : action allowed
--query is in effect; init script would be run if
not for --query.
105 : behaviour uncertain
cannot determine if action should be carried out or
not, and --query in effect.
106 : fallback action requested
the policy layer denied the requested action, and
supplied an allowed fallback action.

+ 102
- 0
doc/README.policy-rc.d View File

@@ -0,0 +1,102 @@

This is the internal documentation for policy-rc.d, as
written by Henrique M Holschuh <>

This document can be found on the web as well at

There is also the Debian BTS entry for the invoke-rc.d policy change at

POLICY-RC.D Policy layer (/usr/sbin/policy-rc.d) interface:

Most Debian systems will not have this script as the need for a policy layer
is not very common. Most people using chroot jails just need an one-line
script which returns an exit status of 101 as the jailed
/usr/sbin/policy-rc.d script.

The /usr/sbin/policy-rc.d file *must* be managed through the alternatives
system (/usr/sbin/update-alternatives) by any packages providing it.

/usr/sbin/policy-rc.d [options] <initscript ID> <actions> [<runlevel>]
/usr/sbin/policy-rc.d [options] --list <initscript ID> [<runlevel> ...]

no error messages are generated.

instead of verifying policy, list (in a "human parseable" way) all
policies defined for the given initscript id (for all runlevels if no
runlevels are specified; otherwise, list it only for the runlevels
specified), as well as all known actions and their fallbacks for the
given initscript id (note that actions and fallback actions might be
global and not particular to a single initscript id).

<actions> is a space-separated list of actions (usually only one). Note that
the list is passed in a single parameter and not as multiple parameters.

The following actions are always known (even if specifying a policy for them
is not supported by whatever policy-rc.d system is in use): start,
[force-]stop, restart, [force-]reload, status.

If an out-of-runlevel start or restart attempt is detected by invoke-rc.d,
the "start" or "restart" action will be changed to "(start)" or "(restart)"
respectively. This allows policy-rc.d to differentiate an out-of-runlevel
start/restart from a normal one.

The runlevel parameters are optional. If a runlevel is not specified, it is
considered to be unknown/undefined. Note that for sysv-like initscript
systems, an undefined runlevel is very likely to cause a 105 exit status.

A runlevel for update-rc.d is defined as a character string, of which the
usual INIT one-character runlevels are only a subset. It may contain
embedded blanks.

stdout is used to output a single line containing fallback actions,
or to output --list results.
stderr is used to output error messages
stdin is not to be used, this is not an interactive interface.

Exit status codes:
0 - action allowed
1 - unknown action (therefore, undefined policy)
100 - unknown initscript id
101 - action forbidden by policy
102 - subsystem error
103 - syntax error
104 - [reserved]
105 - behaviour uncertain, policy undefined.
106 - action not allowed. Use the returned fallback actions
(which are implied to be "allowed") instead.

When in doubt (policy-rc.d returned status 105 or status 1), invoke-rc.d
will assume an action is allowed, but it will warn the user of the problem.

Returning fallback information:

Fallback actions are returned in the first line sent to stdout (other lines
will be discarded). Multiple actions to be tried are allowed, and must be
separated by spaces. Multiple actions are carried out one at a time, until
one is sucessful.

e.g.: returning status 106 and "restart stop" in stdout (without
the quotes) will cause invoke-rc.d to attempt action "restart",
and then only if "restart" failed, attempt action "stop".

invoke-rc.d built-in policy rules:

To shield policy-rc.d of the underlying initscript system (file-rc, links in
/etc/rc?.d or something else), invoke-rc.d implements the following built-in

1. action "start" out of runlevel is denied,
(policy-rc.d receives action "(start)" instead of "start");
2. action "restart" out of runlevel is denied,
(policy-rc.d receives action "(restart)" instead of "restart");
3. any action for a non-executable initscript is denied.

Rule 3 is absolute, policy-rc.d cannot override it.

+ 0
- 14
lib/Debian/Debhelper/Sequence/ View File

@@ -1,14 +0,0 @@
use warnings;
use strict;
use Debian::Debhelper::Dh_Lib;

# dh_systemd_enable runs unconditionally, and before dh_installinit, so that
# the latter can use invoke-rc.d and all symlinks are already in place.
insert_before("dh_installinit", "dh_systemd_enable");

# dh_systemd_start handles the case where there is no corresponding init
# script, so it runs after dh_installinit.
insert_after("dh_installinit", "dh_systemd_start");


+ 206
- 0
man8/es/update-rc.d.8 View File

@@ -0,0 +1,206 @@
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Ian Jackson
.\" (c) 2003 Software in the Public Interest

.\" Traductor: Rubén Porras (
.\" Revisado por : Javier Fernández-Sanguino Peńa (
.\" Esteban Manchado Velázquez (
.\" Está basada en la página de manual original:
.\" versión 1.2 del CVS de /cvs/debian-doc/manpages/english/sysvinit/update-rc.d.8

.TH UPDATE\-RC.D 8 "23 de Diciembre de 2003" "Proyecto Debian" "sysv-rc"
update\-rc.d \- crea y borra los enlaces a los scripts init de tipo
System V
.B update\-rc.d
.RI [ -n ]
.RI [ -f ]
.IB nombre " remove"
.B update-rc.d
.RI [ -n ]
.IB nombre " defaults"
.RI [ NN " | " NN-start " " NN-stop ]
.B update-rc.d
.RI [ -n ]
.I nombre
.BR start | stop
.IR "NN nivel_de_ejecución nivel_de_ejecución " ...
.B .
.BR start | stop
.IR "NN nivel_de_ejecución nivel_de_ejecución " ...
.BR . " ..."
.B update-rc.d
actualiza automáticamente los enlaces a los scripts de init tipo
System V que se encuentran en
.BI /etc/rc[nivel_de_ejecución].d/NNnombre
y que apuntan a los script
.BI /etc/init.d/nombre\fR.
Estos son ejecutados por
.B init
cuando se cambia de nivel de ejecución y se usan generalmente para
arrancar y parar servicios del sistema (por ejemplo, demonios).
.I nivel_de_ejecución
es uno de los soportados por
.BR init ", " 0123456789S ,
es el código de secuencia de dos dígitos usado por
.B init
para decidir en que orden se ejecutan los scripts.

Esta página del manual documenta sólo el modo de uso y comportamiento de
.BR update-rc.d .
Para una explicación más detallada sobre la administración de los
scripts de init estilo System V, por favor, lea
.BR init (8)
y el
.IR "Manual de normativa de Debian" .
Cuando se ejecuta con una o varias de las opciones
.BR defaults ", " start ", o " stop ,
.B update-rc.d
crea los enlaces
.BI /etc/rc[nivel_de_ejecución].d/[SK]NNnombre
apuntando al script
.BI /etc/init.d/nombre\fR.

Si ya existe algún fichero con el nombre
.BI /etc/rc[nivel_de_ejecución].d/[SK]??
.B update-rc.d
no hace nada. Esto es así para que el administrador del sistema pueda
reorganizar los enlaces ( teniendo en cuenta que debe dejar al
menos un enlace si los quiere eliminar ) sin que se sobreescriba su

Si se usa la opción
.B defaults
.B update-rc.d
creará enlaces para arrancar los servicios en los niveles de ejecución
.B 2345
y parar los servicios en los niveles de ejecución
.BR 016 .
Por omisión todos los enlaces tendrán el código de secuencia 20, pero
esto puede cambiarse especificando uno o dos argumentos
.I NN.
Un argumento cambia el valor por omisión del código de secuencia tanto
para los enlaces de arranque como para los de parada, y si se
proporcionan dos argumentos el primero cambia el código de los enlaces
de arranque y el segundo el de los enlaces de parada.

En vez de usar
.B defaults
, los niveles de ejecución en los que se arranca o se para un servicio
pueden ser especificados explícitamente mediante un conjunto de

Cada uno de estos conjuntos empieza con un argumento
.BR start " o " stop
para especificar cuándo se van a crear enlaces para arrancar o parar
el servicio.

Luego les sigue
.IR NN ,
el código de secuencia para todos los enlaces del conjunto, y uno o
más números de nivel de ejecución, cada uno como un solo argumento. El
conjunto se termina con el argumento
.B '.'
(un punto).

Cuando se especifican explícitamente los niveles de ejecución,
normalmente habrá un conjunto
.B start
y otro
.B stop .
Si son necesarios diferentes códigos de secuencia para los
distintos niveles de ejecución, entonces es necesario especificar
varios conjuntos
.B start
.B stop .

El script
.BI /etc/init.d/nombre
debe existir antes de ejecutar
.B update-rc.d
para crear los enlaces.
Cuando se ejecuta con la opción
.I remove
, update-rc.d borra todos los enlaces dentro del directorio
.BI /etc/rc[nivel_de_ejecución].d
que apunten al script
.BI /etc/init.d/nombre\fR .
El script debe haber sido borrado previamente (
.B update-rc.d
lo comprueba ).
Normalmente los scripts post-eliminación de los paquetes ejecutan
.B update-rc.d
cuando detectan que su primer argumento es
.BR purge
, dado que esto indica que el administrador ha pedido explícitamente
que se borren los scripts de configuración proporcionados por el paquete.

Cualquier fichero en los directorios
.BI /etc/rc[nivel_de_ejecución].d
que no sea un enlace simbólico apuntando a un script en
.BI /etc/init.d/nombre
se mantendrá intacto.
.I -n
No hacer nada, solamente indicar que hubiera hecho.
.I -f
Borrar los enlaces incluso si todavía existe el script
.BI /etc/init.d/nombre .
Crear los enlaces usando los parámetros por omisión:
.B update-rc.d foobar defaults
Comando equivalente usando explícitamente un conjunto de argumentos:
.B update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 .

No existe aún una forma para que el administrador pueda especificar al menos
los niveles de ejecución que
.B update-rc.d
usará por defecto para arrancar y parar los servicios cuando se
utilice la opción
.B defaults
ni la posibilidad de cambiar otros comportamientos.
.B /etc/init.d/
El directorio que contienen los scripts de arranque y parada.
.B /etc/rc?.d/
Los directorios que contienen los enlaces usados por
.BR init
y administrados por
.BR update-rc.d .
.B /etc/init.d/skeleton
Un modelo a usar por los que escriban scripts de
.B init.d .

.IR "Manual de normativa de Debian"
, modelo a usar por los que escriban scripts de
.B init.d .

.BR /etc/init.d/skeleton
.BR init (8) .

Traducción de Rubén Porras Campo <>

+ 192
- 0
man8/fr.UTF-8/update-rc.d.8 View File

@@ -0,0 +1,192 @@
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Ian Jackson
.\" Traduction de la révision CVS 1.4
.TH UPDATE\-RC.D 8 "23 décembre 2003" "Projet Debian " "Utilitaires de dpkg"
update\-rc.d \- Pour installer ou supprimer les liens vers les scripts
d'initialisation de type System-V
.B update\-rc.d
.RI [ -n ]
.RI [ -f ]
.IB nom " remove"
.B update-rc.d
.RI [ -n ]
.IB nom " defaults"
.RI [ NN " | " NN-start " " NN-stop ]
.B update-rc.d
.RI [ -n ]
.I nom
.BR start | stop
.IR "NN runlevel runlevel " ...
.B .
.BR start | stop
.IR "NN runlevel runlevel " ...
.BR . " ..."
.B update-rc.d
met à jour automatiquement les liens vers les scripts d'initialisation de type
System-V dont le nom est
.BI /etc/rc runlevel .d/ NNnom
vers les scripts
.BI /etc/init.d/ name \fR.
Ils sont lancés par
.B init
quand on change de niveau de fonctionnement et ils sont généralement utilisés
pour démarrer ou arrêter des services tels que les démons.
.I runlevel
est l'un des niveaux de fonctionnement autorisés par
.BR init ", " 0123456789S ,
est le code à deux chiffres utilisé par
.B init
pour décider de l'ordre d'exécution des scripts.

Cette page de manuel documente seulement le comportement de
.BR update-rc.d
et son utilisation.
Pour une discussion sur la préparation des scripts pour l'initialisation de type System-V voyez
.BR init (8)
et la
.IR "charte Debian" .
Quand update-rc.d est lancé avec les options
.BR defaults ", " start ", ou " stop,
il crée les liens
.BI /etc/rc runlevel .d/[SK] NNname
qui pointent vers le script
.BI /etc/init.d/ name\fR.

Quand des fichiers
.BI /etc/rc runlevel .d/[SK]?? name
existent déjà,
.B update-rc.d
ne fait rien. C'est ainsi pour que l'administrateur système puisse
réarranger les liens -- à condition qu'il en reste au moins un -- sans
que sa configuration ne soit réécrite.

Quand l'option
.B defaults
est utilisée,
.B update-rc.d
crée des liens pour démarrer un service dans les niveaux de fonctionnement
.B 2345
et des liens pour arrêter un service dans les niveaux
.BR 016 .
Par défaut, tous les liens ont un code égal à 20, mais on peut le changer en
donnant un ou deux arguments
.I NN ;
quand un seul argument est donné, il remplace le code à la fois pour les
liens de démarrage (start) et pour les liens d'arrêt (stop) ; quand deux
arguments sont donnés, le premier remplace le code pour les liens de
démarrage (start) et le second remplace le code pour les liens d'arrêt (stop).

Au lieu de
.B defaults,
on peut indiquer les niveaux de fonctionnement dans lesquels lancer ou
arrêter les services en utilisant une suite explicite d'ensembles d'arguments :

Chacun de ces ensembles commence par un argument
.BR start " ou " stop
de manière à indiquer s'il faut créer des liens de démarrage ou d'arrêt.
Ensuite vient le nombre du code
.IR NN ,
pour tous les liens de cet ensemble, puis un ou plusieurs nombres indiquant
le niveau de fonctionnement, un seul argument pour chacun. l'ensemble se
termine par un argument
.B .
(un simple point).

Quand, plutôt que
.BR defaults,
on utilise une détermination explicite, il faut habituellement un ensemble de
.B start,
et un ensemble d'arrêt
.B stop.
Quand on veut différents codes dans les différents niveaux de fonctionnement,
on peut spécifier différents ensembles de démarrage
.B start
ou différents ensembles d'arrêt
.B stop.

Le script
.BI /etc/init.d/ name
doit exister avant de lancer
.B update-rc.d
pour créer les liens.
Quand on appelle update-rc.d avec l'option
.I remove
les liens dans les répertoires
.BI /etc/rc runlevel .d
qui pointent vers le script
.BI /etc/init.d/ name\fR.
sont supprimés.
Ce script doit déjà avoir été supprimé --
.B update-rc.d
vérifie cela.
On appelle habituellement
.B update-rc.d
dans le script « post-removal » d'un paquet et quand ce script a détecté que
son premier argument était
.BR purge ;
Cela indique que l'utilisateur a demandé le suppression de la configuration de
ce paquet.
Tout fichier dans les répertoires
.BI /etc/rc runlevel .d
qui n'est pas un lien symbolique vers le script
.BI /etc/init.d/ name
est préservé.
.I -n
Ne fait rien, montre seulement ce qui pourrait être fait.
.I -f
Force la suppression des liens même si
.BI /etc/init.d/ name
existe encore.
Insère des liens avec l'option « defaults » :
.B " update-rc.d foobar defaults"
La męme commande, avec une détermination explicite utilisant les ensembles
d'arguments :
.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."

Il devrait y avoir un moyen pour l'administrateur système d'indiquer à
.B defaults
au moins les niveaux de fonctionnement par défaut à utiliser pour le
démarrage et l'arrêt des services ; l'administrateur systàme devrait sans
doute aussi pouvoir changer d'autres choses.
.B /etc/init.d/
Le répertoire qui contient en fait les scripts d'initialisation.
.B /etc/rc?.d/
Le répertoire qui contient les liens utilisés par
.BR init
et gérés par
.BR update-rc.d.
.B /etc/init.d/skeleton
Modàle pour l'écriture des scripts de
.B init.d.
.IR "la charte Debian" ,
.BR /etc/init.d/skeleton ,
.BR init (8).
Philippe Batailler. Dec 2000.

+ 230
- 0
man8/invoke-rc.d.8 View File

@@ -0,0 +1,230 @@
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Henrique Holschuh
.TH INVOKE\-RC.D 8 "1 March 2001" "Debian Project" "Debian GNU/Linux"
invoke\-rc.d \- executes System-V style init script actions
.B invoke\-rc.d
.RI [ --quiet ]
.RI [ --force ]
.RI [ --try-anyway ]
.RI [ --disclose-deny ]
.RI [ --query ]
.RI [ --no-fallback ]
.I name
.I action
.RI [ init\ script\ parameters... ]
.B invoke\-rc.d
.RI [ --help ]
.B invoke\-rc.d
is a generic interface to execute System V style init script
.BI /etc/init.d/ name \fR
actions, obeying runlevel constraints as well as any local
policies set by the system administrator.

All access to the init scripts by Debian packages' maintainer
scripts should be done through
.B invoke\-rc.d\fR.

This manpage documents only the usage and behavior of
.BR invoke\-rc.d .
For a discussion of the System V style init script arrangements please
.BR init (8).
More information on invoke-rc.d can be found in the section on
runlevels and init.d scripts of the
.IR "Debian Policy Manual" .

The standard actions are:
.IR start ,
.IR stop ,
.IR force\-stop ,
.IR restart ,
.IR try\-restart ,
.IR reload ,
.IR force\-reload ,
.IR status .
Other actions are accepted, but they can cause problems to
.B policy\-rc.d
(see the
section), so warnings are generated if the policy layer
is active.

Please note that not all init scripts will implement all
the actions listed above, and that the policy layer may
override an action to another action(s), or even deny it.

Any extra parameters will be passed to the init script(s) being

If an action must be carried out regardless of any local
policies, use the
.IR --force

.I --help
Display usage help.
.I --quiet
Quiet mode, no error messages are generated.
.I --force
Tries to run the init script regardless of policy and
init script subsystem errors.
.B Use of this option in Debian maintainer scripts is severely discouraged.
.I --try-anyway
Tries to run the init script if a non-fatal error is
.I --disclose-deny
Return status code 101 instead of status code 0 if
the init script action is denied by the policy layer.
.I --query
Returns one of the status codes 100-106. Does not
run the init script, and implies
.IR --disclose-deny
.IR --no-fallback .
.I --no-fallback
Ignores any fallback action requests by the policy
.B Warning:
this is usually a very bad idea for any actions other
.RI start .
Should an init script be executed,
.B invoke\-rc.d
always returns the status code
returned by the init script. Init scripts should not return status codes in
the 100+ range (which is reserved in Debian and by the LSB). The status codes
returned by invoke\-rc.d proper are:
.IR Success .
Either the init script was run and returned exit status 0 (note
that a fallback action may have been run instead of the one given in the
command line), or it was not run because of runlevel/local policy constrains
.B --disclose-deny
is not in effect.
1 - 99
Reserved for init.d script, usually indicates a failure.
.B Init script ID
.BI ( name )
.BR unknown .
This means the init script was not registered successfully through
.B update\-rc.d
or that the init script does not exist.
.B Action not allowed\fR.
The requested action will not be performed because of runlevel or local
policy constraints.
.B Subsystem error\fR.
Init script (or policy layer) subsystem malfunction. Also, forced
init script execution due to
.I --try-anyway
.I --force
.I Syntax error\fR.
.I Action allowed\fR.
Init script would be run, but
.B --query
is in effect.
.I Behavior uncertain\fR.
It cannot be determined if action should be carried out or not, and
.B --query
is in effect.
.I Fallback action requested\fR.
The policy layer denied the requested action, and
supplied an allowed fallback action to be used instead.

.B invoke\-rc.d
introduces the concept of a policy layer which is used to verify if
an init script should be run or not, or if something else should be
done instead. This layer has various uses, the most immediate ones
being avoiding that package upgrades start daemons out-of-runlevel,
and that a package starts or stops daemons while inside a chroot

The policy layer has the following abilities: deny or approve the
execution of an action; request that another action (called a
.IR fallback )
is to be taken, instead of the action requested in invoke\-rc.d's
command line; or request multiple actions to be tried in order, until
one of them succeeds (a multiple
.IR fallback ).

.B invoke\-rc.d
itself only pays attention to the current runlevel; it will block
any attempts to start a service in a runlevel in which the service is
disabled. Other policies are implemented with the use of the
.B policy\-rc.d
helper, and are only available if
.B /usr/sbin/policy\-rc.d
is installed in the system.

.BR /etc/init.d/*
System V init scripts.
.BR /usr/sbin/policy\-rc.d
Init script policy layer helper (not required).
.BR /etc/runlevel.conf
file-rc runlevel configuration (if the file-rc package is
being used).
.BR /etc/rc?.d/*
System V runlevel configuration (if the sysv-rc package is
being used).

.B invoke\-rc.d
special cases the
.I status
action, and returns exit status 4 instead of exit status 0 when
it is denied.

Please report any bugs using the Debian bug tracking system,, packages sysv\-rc or file\-rc
(depending on which version of invoke\-rc.d you are using).
.IR "Debian Policy manual" ,
.BR /etc/init.d/skeleton ,
.BR update\-rc.d (8),
.BR init (8),
.BR /usr/share/doc/init-system-helpers/README.policy-rc.d.gz

+ 193
- 0
man8/ja/update-rc.d.8 View File

@@ -0,0 +1,193 @@
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Ian Jackson
.\" Original manpage cvs revision 1.4
.TH UPDATE\-RC.D 8 "2 March 1998" "Debian Project" "dpkg utilities"
.SH 名前
update\-rc.d \- System-V スタイルの init スクリプト用のリンクをインストール、削除する
.SH 書式
.B update\-rc.d
.RI [ -n ]
.RI [ -f ]
.IB name " remove"
.B update-rc.d
.RI [ -n ]
.RI [ -f ]
.IB name " defaults"
.RI [ NN " | " NN-start " " NN-stop ]
.B update-rc.d
.RI [ -n ]
.RI [ -f ]
.I name
.BR start | stop
.IR "NN runlevel runlevel " ...
.B .
.BR start | stop
.IR "NN runlevel runlevel " ...
.BR . " ..."
.SH 説明
.B update-rc.d
.BI /etc/init.d/ name \fR
.BI /etc/rc runlevel .d/ NNname
.BI /etc/rc runlevel .d/ NNname
は System V スタイルの init スクリプト用のリンクであり、
.B init
.I runlevel
.BR init
.BR 0123456789S
は 2 桁の数字であり、
.B init

.BR update-rc.d
System V スタイルの init スクリプトの配置についての議論には、
.BR init (8)
.IR "dpkg programmers' manual"
.SH INIT スクリプト用のリンクをインストールする
.BR defaults ", " start ", " stop
update-rc.d は
.BI /etc/rc runlevel .d/[SK] NNname
.BI /etc/init.d/ name\fR

.BI /etc/rc runlevel .d/[SK]?? name
.B update-rc.d

.B defaults
.B update-rc.d
.B 2345
.BR 016
のシーケンスコード 20 を持つが、引数

.B defaults

.BR start " または " stop
.B .

.BR defaults
.B start
.B stop

.B start
.B stop

.B update-rc.d
.BI /etc/init.d/ name
.SH リンク削除用のスクリプト
.I remove
.BI /etc/rc runlevel .d
.BI /etc/init.d/ name\fR
.B update-rc.d
.B update-rc.d
はパッケージの postrm スクリプトから呼び出される。
これが実行されるのは、postrm スクリプトの第1引数として
.BR purge
.BI /etc/rc runlevel .d
.BI /etc/init.d/ name
.SH オプション
.I -n
.I -f
.BI /etc/init.d/ name
.SH 使用例
defaults を使用したリンクの作成
.B " update-rc.d foobar defaults"
.B " update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 ."
.SH バグ
.B defaults
でどのランレベルを start または stop にするかを指定できる方法が必要である。
.B defaults
.SH ファイル
.B /etc/init.d/
init スクリプトが実際に置いてあるディレクトリ
.B /etc/rc?.d/
.BR update-rc.d
.BR init
.B /etc/init.d/skeleton
.B init.d
.SH 関連項目
.IR "dpkg programmers manual" ,
.BR /etc/init.d/skeleton ,
.BR init (8).
.SH 翻訳者
鍋谷 栄展 <>

+ 103
- 0
man8/service.8 View File

@@ -0,0 +1,103 @@
.\" A man page for service(8). -*- nroff -*-
.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
.\" This copyrighted material is made available to anyone wishing to use,
.\" modify, copy, or redistribute it subject to the terms and conditions of the
.\" GNU General Public License v.2.
.\" This program is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
.\" more details.
.\" You should have received a copy of the GNU General Public License along
.\" with this program; if not, write to the Free Software Foundation, Inc.,
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.\" Author: Miloslav Trmac <>
.\" Updated by: Petter Reinholdtsen <>

.TH service 8 "Jan 2006"

service \- run a System V init script

\fBservice\fR \fISCRIPT\fR \fICOMMAND\fR [\fIOPTIONS\fR]

\fBservice \-\-status\-all\fR

\fBservice\fR \fB\-\-help\fR | \fB\-h\fR | \fB\-\-version\fR

.B service
runs a System V init script or systemd unit in as predictable an
environment as possible, removing most environment variables and with the
current working directory set to \fB/\fR.

parameter specifies a System V init script,
located in \fB/etc/init.d/\fISCRIPT\fR, or the name of a systemd unit.
The existence of a systemd unit of the same name as a script in /etc/init.d
will cause the unit to take precedence over the init.d script.
The supported values of
depend on the invoked script.
.B service
to the init script unmodified. For systemd units, start, stop,
status, and reload are passed through to their systemctl/initctl

All scripts should support at least the
.B start
.B stop
As a special case, if
is \fB\-\-full-restart\fR, the script is run twice, first with the
.B stop
command, then with the
.B start

.B service \-\-status\-all
runs all init scripts, in alphabetical order, with the
.B status
command. The status is [ + ] for running services, [ - ] for stopped
services and [ ? ] for services without a 'status' command. This
option only calls status for sysvinit jobs.

.BR service
calls the init script and returns the status returned by it.

The directory containing System V init scripts.
The directories containing systemd units.

The only environment variables passed to the init scripts.

.IR /etc/init.d/skeleton ,
.BR update\-rc.d (8),
.BR init (8),
.BR invoke\-rc.d (8).
.BR systemctl (1).

+ 215
- 0
man8/update-rc.d.8 View File

@@ -0,0 +1,215 @@
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Authors: Ian Jackson, Miquel van Smoorenburg
.TH "UPDATE\-RC.D" "8" "14 November 2005" "Debian Project" "sysv-rc"
update\-rc.d \- install and remove System\-V style init script links
.B update\-rc.d
.RI [ \-n ]
.RI [ \-f ]
.IB name " remove"
.B update\-rc.d
.RI [ \-n ]
.IB name " defaults"
.B update\-rc.d
.RI [ \-n ]
.IB name " disable|enable "
.RI [ " S|2|3|4|5 " ]
.B update\-rc.d
updates the System V style init script links
.BI /etc/rc runlevel .d/ NNname
whose target is the script
.BI /etc/init.d/ name \fR.
These links are run by
.B init
when it changes runlevels; they are generally used to start and stop
system services such as daemons.
.I runlevel
is one of the runlevels supported by
.BR init ", namely, " 0123456789S ", and "
is the two\-digit sequence number that determines where in the sequence
.B init
will run the scripts.

This manpage documents only the usage and behaviour of
.BR update\-rc.d .
For a discussion of the System V style init script arrangements please
.BR init (8)
and the
.IR "Debian Policy Manual" .

update\-rc.d requires dependency and runlevel information to be
provided in the init.d script LSB comment header of all init.d scripts.
See the insserv(8) manual page for details about the LSB header format.

When run with the
.BR defaults
.B update\-rc.d
makes links named
.BI /etc/rc runlevel .d/[SK] NNname
that point to the script
.BR /etc/init.d/ \fIname\fR,
using runlevel and dependency information from the init.d script LSB
comment header.

If any files named
.BI /etc/rc runlevel .d/[SK]?? name
already exist then
.B update\-rc.d
does nothing.
The program was written this way so that it will never
change an existing configuration, which may have been
customized by the system administrator.
The program will only install links if none are present,
if it appears that the service has never been installed before.
Older versions of
.B update\-rc.d
also supported
.BR start
.BR stop
options. These options are no longer supported, and are now
equivalent to the
.BR defaults
A common system administration error is to delete the links
with the thought that this will "disable" the service, i.e.,
that this will prevent the service from being started.
However, if all links have been deleted then the next time
the package is upgraded, the package's
.I postinst
script will run
.B update\-rc.d
again and this will reinstall links at their factory default locations.
The correct way to disable services is to configure the
service as stopped in all runlevels in which it is started by default.
In the System V init system this means renaming
the service's symbolic links
.B S
.BR K .
The script
.BI /etc/init.d/ name
must exist before
.B update\-rc.d
is run to create the links.
When invoked with the
.I remove
option, update\-rc.d removes any links in the
.BI /etc/rc runlevel .d
directories to the script
.BI /etc/init.d/ name\fR.
The script must have been deleted already.
If the script is still present then
.B update\-rc.d
aborts with an error message.
.B update\-rc.d
is usually called from a package's post\-removal script when that
script is given the
.B purge
Any files in the
.BI /etc/rc runlevel .d
directories that are not symbolic links to the script
.BI /etc/init.d/ name
will be left untouched.
When run with the
.BR disable " [ " S|2|3|4|5 " ] "
.B update\-rc.d
modifies existing runlevel links for the script
.BR /etc/init.d/ \fIname\fR
by renaming start links to stop links with a sequence number equal