<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="telinit">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>telinit</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo class="manual">administrator commands</refmiscinfo>
<refmiscinfo class="source">nosh</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv>
<refname>telinit</refname>
<refname>chkconfig</refname>
<refname>deb-systemd-invoke</refname>
<refname>emergency</refname>
<refname>fastboot</refname>
<refname>fasthalt</refname>
<refname>fastpowercycle</refname>
<refname>fastpoweroff</refname>
<refname>halt</refname>
<refname>haltsys</refname>
<refname>init</refname>
<refname>initctl</refname>
<refname>invoke-rc.d</refname>
<refname>normal</refname>
<refname>powercycle</refname>
<refname>poweroff</refname>
<refname>rc-service</refname>
<refname>rc-update</refname>
<refname>rcctl</refname>
<refname>reboot</refname>
<refname>rescue</refname>
<refname>runlevel</refname>
<refname>service</refname>
<refname>svcadm</refname>
<refname>update-rc.d</refname>
<refpurpose>BSD, System 5, and SunOS compatibility utilities for system and service control</refpurpose>
</refnamediv>

<refsection><title>Description</title>

<para>
<command>telinit</command> is a multiple personality program, whose function varies according to what name it is invoked as.
</para>

<caution>
The various commands that it provides are compatibility shims only; they do not support the full capabilities of the original commands, only a common-use subset for providing an easy migration path for old BSD and System 5 habits and scripts.
Avoid using them if possible.
</caution>

<para>
Or one can just use the <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry> command directly.
</para>

<refsection><title>Compatibility system control commands</title>

<para>
These commands are all shims around <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>, either directly or indirectly via <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para>

<refsection><title>General</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>telinit</command>
<arg choice="opt" rep="repeat"><replaceable>args</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>init</command>
<arg choice="opt" rep="repeat"><replaceable>args</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>runlevel</command>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>telinit</command> <arg choice="plain" rep='repeat'><replaceable>args</replaceable></arg> or as <command>init</command> <arg choice="plain" rep='repeat'><replaceable>args</replaceable></arg> the program chains to <command>system-control</command> <arg choice="plain">init</arg> <arg choice="plain" rep='repeat'><replaceable>args</replaceable></arg>, the behaviour of which is documented in <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>

<para>
No attempt is made to validate <arg choice="plain"><replaceable>args</replaceable></arg>; however it must have the same form as is used by the loader and kernel to pass arguments to process #1 at bootstrap.
See the <command>init</command> subcommand of <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry> for details.
</para>

<warning>
It is a mistake to run this as process #1, thinking that it is an alias for <citerefentry><refentrytitle>system-manager</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
It is not, and on some systems the executable is dynamically linked to libraries in <filename>/usr/lib</filename> which isn't present at boot time.
Configure the system to invoke <citerefentry><refentrytitle>system-manager</refentrytitle><manvolnum>8</manvolnum></citerefentry> directly, optionally under the name <command>init</command>, instead.
</warning>

<warning>
It is likewise a mistake to run this thinking that it is an alias for <citerefentry><refentrytitle>per-user-manager</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Again, invoke that directly, optionally under the name <command>init</command>.
</warning>

<para>
Invoked as <command>runlevel</command>, this simply prints "N" twice, to indicate that runlevels do not exist.
</para>

<caution>
This command exists for compatibility with some badly-written package installation/uninstallation scripts.
It doesn't print "unknown", because those scripts are so badly written that they cannot even cope with <command>runlevel</command> not emitting two words.
Do not use this obsolete command.
</caution>

</refsection>

<refsection><title>Startup</title>
<refsynopsisdiv>
<cmdsynopsis><command>emergency</command></cmdsynopsis>
<cmdsynopsis><command>rescue</command></cmdsynopsis>
<cmdsynopsis><command>normal</command></cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as one of the system control commands <command>emergency</command>, <command>rescue</command>, or <command>normal</command>, it will chain to <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>8</manvolnum></citerefentry> inserting that as the 0th argument and passing the original arguments as the subcommand.
</para>

</refsection>

<refsection><title>Shutdown</title>
<refsynopsisdiv>
<cmdsynopsis>
<command>reboot</command>
<group choice="opt">
<arg choice="plain">-f</arg>
<arg choice="plain">--force</arg>
</group>
<arg choice="opt">--halt</arg>
<arg choice="opt">--reboot</arg>
<arg choice="opt">--powercycle</arg>
<arg choice="opt">--poweroff</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>halt</command>
<group choice="opt">
<arg choice="plain">-f</arg>
<arg choice="plain">--force</arg>
</group>
<arg choice="opt">--halt</arg>
<arg choice="opt">--reboot</arg>
<arg choice="opt">--powercycle</arg>
<arg choice="opt">--poweroff</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>powercycle</command>
<group choice="opt">
<arg choice="plain">-f</arg>
<arg choice="plain">--force</arg>
</group>
<arg choice="opt">--halt</arg>
<arg choice="opt">--reboot</arg>
<arg choice="opt">--powercycle</arg>
<arg choice="opt">--poweroff</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>poweroff</command>
<group choice="opt">
<arg choice="plain">-f</arg>
<arg choice="plain">--force</arg>
</group>
<arg choice="opt">--halt</arg>
<arg choice="opt">--reboot</arg>
<arg choice="opt">--powercycle</arg>
<arg choice="opt">--poweroff</arg>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as one of the system control commands <command>reboot</command>, <command>halt</command>, <command>powercycle</command>, or <command>poweroff</command> it will normally chain to <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry> with the <arg choice='plain'>-r</arg>, <arg choice='plain'>-h</arg>, <arg choice='plain'>-c</arg>, or <arg choice='plain'>-p</arg> command-line option respectively.
<citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry> is then responsible for issuing the relevant commands to the system manager.
The <arg choice='plain'>--halt</arg>, <arg choice='plain'>--reboot</arg>, <arg choice='plain'>--powercycle</arg>, and <arg choice='plain'>--poweroff</arg> command-line options force which option is sent to <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry>, for the benefits of system administrators who enjoy giving computers self-contradictory instructions like <command>reboot</command> <arg choice="plain">--halt</arg>.
</para>

<para>
The <arg choice='plain'>--force</arg> command-line option specifies that the shutdown process should bypass service changes and enact the finalization action immediately.
When it is used the command will instead chain to the <arg choice="req">reboot</arg>, <arg choice="req">halt</arg>, <arg choice="req">powercycle</arg>, and <arg choice="req">poweroff</arg> subcommands of <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>8</manvolnum></citerefentry>, passing the <arg choice='plain'>--force</arg> command-line option through.
This will also bypass whatever actions <citerefentry><refentrytitle>shutdown</refentrytitle><manvolnum>8</manvolnum></citerefentry> would have taken, including writing warning messages to users and writing login accounting database entries.
</para>

<para>
Invoked as one of the system control commands <command>fastboot</command>, <command>fasthalt</command>, <command>fastpowercycle</command>, or <command>fastpoweroff</command>, it will act as if invoked as <command>reboot</command>, <command>halt</command>, <command>powercycle</command>, or <command>poweroff</command> with the <arg choice='plain'>--force</arg> command-line option.
</para>

<para>
<command>haltsys</command> is an alias for <command>halt</command> provided for rough compatibility with the XENIX and UnixWare extensions to System 5.
It does not support their <arg choice='plain'>-d</arg> option, whose behaviour is strongly tied to those particular platforms.
</para>

</refsection>
</refsection>
<refsection><title>Compatibility service control and configuration commands</title>

<para>
These commands are all shims around <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
As such, they all operate on native nosh services, not on old BSD or System 5 shell scripts.
Their actions are defined in terms of service management actions, not in terms of running shell scripts.
For example:
<command>service</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain">start</arg> has the meaning of starting a named service, not of invoking a shell script with an argument.
</para>

<para>
These commands and will enforce correct service dependencies and start/stop orderings, unlike the original BSD and System 5 service management systems.
For individual control of services without orderings or dependencies, use <citerefentry><refentrytitle>service-control</refentrytitle><manvolnum>1</manvolnum></citerefentry> or <citerefentry><refentrytitle>service-status</refentrytitle><manvolnum>1</manvolnum></citerefentry> directly instead.
</para>

<refsection><title>Generic</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>service</command>
<arg choice="opt">--verbose</arg>
<arg choice="req"><replaceable>name</replaceable></arg>
<arg choice="req"><replaceable>command</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>service</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain"><replaceable>command</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, passing along any <arg choice='plain'>--verbose</arg> option.
It makes no attempt itself to validate <replaceable>command</replaceable>, which can be any of the subcommands supported by <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
However, for best results restrict <replaceable>command</replaceable> to one of <arg choice="plain">start</arg>, <arg choice="plain">stop</arg>, or <arg choice="plain">status</arg>.
</para>

<note>
Unlike the BSD <citerefentry><refentrytitle>service</refentrytitle><manvolnum>8</manvolnum></citerefentry> command, <command>service</command> can manually start and stop disabled services.
</note>

</refsection>

<refsection><title>OpenBSD rc</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>rcctl</command>
<arg choice="req"><replaceable>command</replaceable></arg>
<arg choice="req"><replaceable>name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>rcctl</command> <arg choice="plain"><replaceable>command</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, unless <arg choice="plain"><replaceable>command</replaceable></arg> is either <arg choice="plain">set</arg> or <arg choice="plain">get</arg> the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>.
It makes no attempt itself to validate <replaceable>command</replaceable>, which can be any of the subcommands supported by <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
<arg choice="plain">set</arg> is replaced with <arg choice="plain">set-service-env</arg>.
<arg choice="plain">get</arg> is replaced with <arg choice="plain">print-service-env</arg>.
</para>

<caution>
Do not use <command>rcctl</command> <arg choice="plain">set</arg> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain">status</arg> to enable or disable services.
This is not even correct for the original tool, as only OpenBSD uses variables named <replaceable>name</replaceable><code>_status</code> in the first place.
Other BSDs have different names which won't work with this OpenBSD-specific syntax.
In contrast, <command>rcctl</command> <arg choice="plain">enable</arg> <arg choice="plain"><replaceable>name</replaceable></arg> and <command>rcctl</command> <arg choice="plain">disable</arg> <arg choice="plain"><replaceable>name</replaceable></arg>, defined as equivalents in the original OpenBSD tool, will work portably.
</caution>

</refsection>

<refsection><title>OpenRC</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>rc-service</command>
<arg choice="opt">--verbose</arg>
<arg choice="req"><replaceable>name</replaceable></arg>
<arg choice="req"><replaceable>command</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>rc-update</command>
<group choice="req">
<arg choice="plain">add</arg>
<arg choice="plain">delete</arg>
</group>
<arg choice="req"><replaceable>name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>rc-service</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain"><replaceable>command</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, passing along any <arg choice='plain'>--verbose</arg> option.
It makes no attempt itself to validate <replaceable>command</replaceable>, which can be any of the subcommands supported by <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
However, for best results restrict <replaceable>command</replaceable> to one of <arg choice="plain">start</arg>, <arg choice="plain">stop</arg>, or <arg choice="plain">status</arg>.
</para>

<para>
Invoked as <command>rc-update</command> <arg choice="plain"><replaceable>command1</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command2</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>.
<replaceable>command1</replaceable> may only be one of <arg choice="plain">add</arg> or <arg choice="plain">del</arg>, which are translated to <arg choice="plain">preset</arg> and <arg choice="plain">disable</arg> (respectively) for <replaceable>command2</replaceable>.
</para>

</refsection>

<refsection><title>Upstart</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>initctl</command>
<group choice="req">
<arg choice="plain">version</arg>
<arg choice="plain">start</arg>
<arg choice="plain">stop</arg>
<arg choice="plain">status</arg>
<arg choice="plain">show-config</arg>
</group>
<arg choice="req"><replaceable>name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>initctl</command> <arg choice="plain"><replaceable>command1</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command2</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, translating as in the following table.
</para>
<table>
<title>Sub-command translation:</title>
<thead>
<tr><td><replaceable>command1</replaceable></td><td><replaceable>command2</replaceable></td></tr>
</thead>
<tbody>
<tr><td><arg choice='plain'>show-config</arg></td><td><arg choice='plain'>show-json</arg></td></tr>
<tr><td><arg choice='plain'>start</arg></td><td><arg choice='plain'>start</arg></td></tr>
<tr><td><arg choice='plain'>status</arg></td><td><arg choice='plain'>status</arg></td></tr>
<tr><td><arg choice='plain'>stop</arg></td><td><arg choice='plain'>stop</arg></td></tr>
<tr><td><arg choice='plain'>version</arg></td><td><arg choice='plain'>version</arg></td></tr>
</tbody>
</table>

<para>
No other functionality of the original <command>initctl</command> tool is supported.
</para>

</refsection>

<refsection><title>Solaris SMF</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>svcadm</command>
<group choice="req">
<arg choice="plain">version</arg>
<arg choice="plain">enable</arg>
<arg choice="plain">disable</arg>
</group>
<arg choice="req"><replaceable>name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>svcadm</command> <arg choice="plain"><replaceable>command1</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command2</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, translating as in the following table.
</para>
<table>
<title>Sub-command translation:</title>
<thead>
<tr><td><replaceable>command1</replaceable></td><td><replaceable>command2</replaceable></td></tr>
</thead>
<tbody>
<tr><td><arg choice='plain'>disable</arg></td><td><arg choice='plain'>stop</arg></td></tr>
<tr><td><arg choice='plain'>enable</arg></td><td><arg choice='plain'>start</arg></td></tr>
<tr><td><arg choice='plain'>version</arg></td><td><arg choice='plain'>version</arg></td></tr>
</tbody>
</table>

<para>
No other functionality of the original <command>svcadm</command> tool is supported.
For the <command>milestone</command> subcommand, start the appropriate combination of standard targets.
There is no simple 1:1 correspondence between standard targets and SMF milestone names.
</para>

</refsection>

<refsection><title>IRIX</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>chkconfig</command>
<arg choice="req"><replaceable>name</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>chkconfig</command>
<group choice="opt">
<arg choice="plain">-f</arg>
<arg choice="plain">--force</arg>
</group>
<arg choice="req"><replaceable>name</replaceable></arg>
<group choice="req">
<arg choice="plain">reset</arg>
<arg choice="plain">on</arg>
<arg choice="plain">off</arg>
</group>
</cmdsynopsis>
</refsynopsisdiv>

<para>
Invoked as <command>chkconfig</command> <arg choice="plain"><replaceable>name</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain">is-enabled</arg> <arg choice="plain"><replaceable>name</replaceable></arg>.
</para>

<para>
Invoked as <command>chkconfig</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain"><replaceable>command1</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command2</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, translating as in the following table.
</para>
<table>
<title>Sub-command translation:</title>
<thead>
<tr><td><replaceable>command1</replaceable></td><td><replaceable>command2</replaceable></td></tr>
</thead>
<tbody>
<tr><td><arg choice='plain'>reset</arg></td><td><arg choice='plain'>preset</arg></td></tr>
<tr><td><arg choice='plain'>on</arg></td><td><arg choice='plain'>enable</arg></td></tr>
<tr><td><arg choice='plain'>off</arg></td><td><arg choice='plain'>disable</arg></td></tr>
</tbody>
</table>

<para>
The <arg choice='plain'>--force</arg> option has no translatable meaning, does nothing, and is present for compatibility only.
The IRIX <citerefentry><refentrytitle>chkconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry> tool manipulated (possibly non-existent) flag files in <filename>/var/config</filename> and required a flag to force the creation of non-existent files.
This has no meaning with <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Conversely, <arg choice="plain">reset</arg> has no meaning for the IRIX original, where flag files had no "preset" information to be initialized from.
</para>

<para>
The remaining functionality of the IRIX <citerefentry><refentrytitle>chkconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry> tool, without any <arg choice="plain"><replaceable>name</replaceable></arg> argument and with an optional <arg choice="plain">-s</arg> option, is not supported at all.
There is no one big central state directory used by <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>8</manvolnum></citerefentry> to list.
Rather, enable/disable states are distributed around the service bundle directories, and are relative to one or more targets.
</para>

<refsection><title>History</title>

<para>
This is a shim for <ulink url="https://nixdoc.net/man-pages/IRIX/man1/chkconfig.1.html">the IRIX command by this name</ulink>.
The IRIX original had no concept of preset information, and was purely an access method for named on/off configuration flag files which theoretically had any use one liked.
It was conceptually like the flags in the BSD <citerefentry><refentrytitle>rc.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> system, which have arbitrary uses (but which can, however, represent more than on/off boolean data, which the IRIX system was limited to).
</para>

<para>
Miquel van Smoorenberg wrote a similar tool, that used and altered completely different configuration information for van Smoorenberg's <citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry> system.
It was limited to solely service enable/disable states, and no longer supported arbitrary uses for named flags.
van Smoorenberg's <citerefentry><refentrytitle>chkconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry> added a different command-line syntax, not in the IRIX original, which is not supported by this command.
They have only the original IRIX syntax in common, along with the <arg choice="plain">reset</arg> argument, which is a van Smoorenberg addition to the IRIX original that took preset information held in comments in <citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry> scripts.
(The added, different, van Smoorenberg syntax was for adding and removing services, rather than enabling and disabling them, which has no translatable meaning.)
</para>

<para>
That then in turn inspired Joe Oppegaard's <citerefentry><refentrytitle>sysv-rc-conf</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Oppegaard's <citerefentry><refentrytitle>sysv-rc-conf</refentrytitle><manvolnum>8</manvolnum></citerefentry> altered the original IRIX syntax incompatibly, and is thus wholly incompatible with both this command and the IRIX original.
</para>

<para>
Erik Troan's <citerefentry><refentrytitle>chkconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry> tool for CentOS/RedHat expanded upon van Smoorenberg's added, different, syntax; and again has only the original IRIX syntax (plus the van Smoorenberg <arg choice="plain">reset</arg>) in common with this command.
Michael Schroeder's <citerefentry><refentrytitle>chkconfig</refentrytitle><manvolnum>8</manvolnum></citerefentry> tool for SuSE discarded all of the original IRIX syntax, leaving the van Smooorenberg added different one, and thus has no common syntax with this command.
</para>

</refsection>

</refsection>

<refsection><title>Debian maintainer script utilities</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>invoke-rc.d</command>
<arg choice="req"><replaceable>name</replaceable></arg>
<group choice="opt">
<arg choice="plain">-q</arg>
<arg choice="plain">--quiet</arg>
</group>
<arg choice="opt">--user</arg>
<arg choice="opt">--skip-systemd-native</arg>
<group choice="req">
<arg choice="plain">start</arg>
<arg choice="plain">stop</arg>
</group>
</cmdsynopsis>
<cmdsynopsis>
<command>update-rc.d</command>
<arg choice="req"><replaceable>name</replaceable></arg>
<group choice="opt">
<arg choice="plain">-f</arg>
<arg choice="plain">--force</arg>
</group>
<arg choice="plain">--user</arg>
<group choice="req">
<arg choice="plain">enable</arg>
<arg choice="plain">disable</arg>
<arg choice="plain">remove</arg>
<arg choice="plain">defaults</arg>
</group>
</cmdsynopsis>
<cmdsynopsis>
<command>deb-systemd-invoke</command>
<arg choice="req"><replaceable>name</replaceable></arg>
<group choice="opt">
<arg choice="plain">-q</arg>
<arg choice="plain">--quiet</arg>
</group>
<arg choice="plain">--user</arg>
<group choice="req">
<arg choice="plain">start</arg>
<arg choice="plain">stop</arg>
</group>
</cmdsynopsis>
</refsynopsisdiv>

<caution>
Avoid using these commands outwith package installation/uninstallation scripts.
They are tailored for such use in particular.
</caution>

<para>
Invoked as either <command>invoke-rc.d</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain"><replaceable>command1</replaceable></arg> or <command>deb-systemd-invoke</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain"><replaceable>command1</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command2</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>.
<replaceable>command1</replaceable> may only be one of <arg choice="plain">start</arg> or <arg choice="plain">stop</arg>, which are translated to <arg choice="plain">reset</arg> and <arg choice="plain">stop</arg> (respectively) for <replaceable>command2</replaceable>.
The behaviour that it is designed to be backwards compatible with only starting a service in response to the <arg choice="plain">start</arg> subcommand if the administrator has configured the service to auto-start.
Hence the replacement of <arg choice="plain">start</arg> by <arg choice="plain">reset</arg>.
</para>

<para>
The <arg choice='plain'>--user</arg> option is simply passed through to <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
The <arg choice='plain'>--quiet</arg> option has no translatable meaning, does nothing, and is present for compatibility only.
The <arg choice='plain'>--skip-systemd-native</arg> option also does nothing, and is present for compatibility only.
</para>

<para>
Invoked as <command>update-rc.d</command> <arg choice="plain"><replaceable>name</replaceable></arg> <arg choice="plain"><replaceable>command1</replaceable></arg>, the program chains to <command>system-control</command> <arg choice="plain"><replaceable>command2</replaceable></arg> <arg choice="plain"><replaceable>name</replaceable></arg>, translating as in the following table.
Again, the behaviour that it is designed to be backwards compatible with only enables a service in response to the <arg choice="plain">enable</arg> subcommand if the administrator has configured the service to auto-start.
Hence the use of <arg choice="plain">preset</arg>.
</para>
<table>
<title>Sub-command translation:</title>
<thead>
<tr><td><replaceable>command1</replaceable></td><td><replaceable>command2</replaceable></td></tr>
</thead>
<tbody>
<tr><td><arg choice='plain'>defaults</arg></td><td><arg choice='plain'>preset</arg></td></tr>
<tr><td><arg choice='plain'>start</arg></td><td><arg choice='plain'>preset</arg></td></tr>
<tr><td><arg choice='plain'>stop</arg></td><td><arg choice='plain'>preset</arg></td></tr>
<tr><td><arg choice='plain'>enable</arg></td><td><arg choice='plain'>preset</arg></td></tr>
<tr><td><arg choice='plain'>disable</arg></td><td><arg choice='plain'>disable</arg></td></tr>
<tr><td><arg choice='plain'>remove</arg></td><td><arg choice='plain'>disable</arg></td></tr>
</tbody>
</table>
<note>
<ulink url="http://anonscm.debian.org/cgit/collab-maint/sysvinit.git/commit/?id=6323a1e4eb39ed1c050b1e74b6baef92dcfde4b1">the original <command>update-rc.d</command> tool eliminated all support for non-LSB-header-based System 5 <command>rc</command>, in July 2013.</ulink>
The <arg choice="plain">defaults</arg>, <arg choice="plain">start</arg>, and <arg choice="plain">stop</arg> subcommands do not take arguments even in the original tool; and uses of the latter two subcommands should be replaced by the former.
</note>

<para>
The <arg choice='plain'>--user</arg> option is simply passed through to <citerefentry><refentrytitle>system-control</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
The <arg choice='plain'>--force</arg> option has no translatable meaning, does nothing, and is present for compatibility only.
</para>

</refsection>

</refsection>

<refsection><title>telinit server</title>

<refsynopsisdiv>
<cmdsynopsis>
<command>initctl-read</command>
</cmdsynopsis>
</refsynopsisdiv>

<para>
<command>initctl-read</command> is a UCSPI telinit server.
It expects file descriptor 3 to be a FIFO that has been set up, with <citerefentry><refentrytitle>fifo-listen</refentrytitle><manvolnum>1</manvolnum></citerefentry> or similar, to listen for incoming messages.
Usually, its standard error will be redirected to an instance of <citerefentry><refentrytitle>cyclog</refentrytitle><manvolnum>1</manvolnum></citerefentry> or similar.
</para>

<para>
It loops forever, reading request messages and executing the requested commands.
Although the van Smoorenburg telinit requests protocol defines a wide range of requests, all are dishonoured except for runlevel changes, which are (in a reversal of the van Smoorenburg system) simply passed over to <command>telinit</command> for enacting, which in turn hands them over to <command>system-control</command> <arg choice="plain">init</arg> as explained in a preceding section.
No validation is made on the run level requested except that it be a printable character.
</para>

<caution>
This program speaks the control protocol of the van Smoorenburg init and telinit programs.
That protocol is not compatible with <othercredit><firstname>Joachim</firstname> <surname>Wiberg's</surname></othercredit> (formerly <othercredit><surname>Nilsson</surname></othercredit>) finit program, which has a similar FIFO.
Almost no programs expect or use this interface, <ulink url="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657990#57">which the maintainers of the van Smoorenburg init package themselves consider to be private and deprecated</ulink>.
</caution>
<warning>
Do not use this interface in power monitoring softwares.
Send <code>SIGPWR</code> to process #1, writing the power event to <filename>/run/powerstatus</filename> or equivalent (depending from the operating system), instead.
</warning>

</refsection>

</refsection>

<refsection><title>Author</title>
<para><author><personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname></author></para>
</refsection>

</refentry>
