mirror of https://github.com/slicer69/insserv.git
529 lines
15 KiB
Groff
529 lines
15 KiB
Groff
.\"
|
|
.\" Copyright 2000-2009 Werner Fink
|
|
.\" Copyright 2000-2003 SuSE GmbH Nuernberg, Germany
|
|
.\" Copyright 2007-2009 SuSE Linux Products GmbH Nuernberg, Germany
|
|
.\" Copyright 2009 Petter Reinholdtsen
|
|
.\"
|
|
.\" 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 of the License, 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
|
|
.\" 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
|
|
.\"
|
|
@@BEGIN_SUSE@@
|
|
.TH INSSERV 8 "July 29, 2008" "Version 1.11" "The SuSE boot concept"
|
|
.UC 8
|
|
@@ELSE_SUSE@@
|
|
.TH INSSERV 8 "July 29, 2008" "Version 1.11"
|
|
.UC 8
|
|
@@END_SUSE@@
|
|
.SH NAME
|
|
insserv \- boot sequence organizer using LSB init.d script dependency information
|
|
.SH SYNOPSIS
|
|
.\"
|
|
.B insserv
|
|
.RB [ \-v ]
|
|
.RB [ \-c\ <config> ]
|
|
.RB [ \-p\ <path> ]
|
|
.RB [ \-d ]
|
|
.RB [ \-f ]
|
|
.RI [[ / ] path/to/init.d/ ] script \ ...
|
|
.PP
|
|
.\" avoid excessive space between words in troff caused by a long text string
|
|
.nr AD \n(.j
|
|
.ad l
|
|
.B insserv
|
|
.RB [ \-v ]
|
|
.RB [ \-c\ <config> ]
|
|
.RB [ \-p\ <path> ]
|
|
.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1,lvl2,...>,stop=<lvl1,lvl2,...> ]
|
|
.ad \n(AD
|
|
.PP
|
|
.B insserv
|
|
.RB [ \-v ]
|
|
.RB [ \-c\ <config> ]
|
|
.RB [ \-p\ <path> ]
|
|
.B \-r
|
|
.RB [ \-d ]
|
|
.RB [ \-f ]
|
|
.RI [[ / ] path/to/init.d/ ] script \ ...
|
|
.PP
|
|
.B insserv
|
|
.B \-h
|
|
.PP
|
|
@@BEGIN_SUSE@@
|
|
.RB /usr/lib/lsb/install_initd
|
|
.RI [[ / ] path/to/init.d/script ]
|
|
.PP
|
|
.RB /usr/lib/lsb/remove_initd
|
|
.RI [[ / ] path/to/init.d/script ]
|
|
@@END_SUSE@@
|
|
.SH DESCRIPTION
|
|
.B insserv
|
|
is a low level tool used by
|
|
.B update\-rc.d
|
|
which enables an installed system
|
|
init script (`boot script') by reading the comment header of the script, e.g.:
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
### BEGIN INIT INFO
|
|
# Provides: boot_facility_1 [ boot_facility_2 ...]
|
|
# Required-Start: boot_facility_1 [ boot_facility_2 ...]
|
|
# Required-Stop: boot_facility_1 [ boot_facility_2 ...]
|
|
# Should-Start: boot_facility_1 [ boot_facility_2 ...]
|
|
# Should-Stop: boot_facility_1 [ boot_facility_2 ...]
|
|
# X-Start-Before: boot_facility_1 [ boot_facility_2 ...]
|
|
# X-Stop-After: boot_facility_1 [ boot_facility_2 ...]
|
|
# Default-Start: run_level_1 [ run_level_2 ...]
|
|
# Default-Stop: run_level_1 [ run_level_2 ...]
|
|
# X-Interactive: true
|
|
# Short-Description: single_line_description
|
|
# Description: multiline_description
|
|
### END INIT INFO
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
and calculating the dependencies between all scripts. It is not recommended to
|
|
execute insserv directly unless you know exactly what you're doing, doing so
|
|
may render your boot system inoperable.
|
|
.B update\-rc.d
|
|
is the recommended interface for managing init scripts.
|
|
.PP
|
|
The
|
|
.B Default\-Start
|
|
keyword declares on which runlevels the script must be started. An empty
|
|
value means the script will never be started.
|
|
@@BEGIN_SUSE@@
|
|
Please note, that the
|
|
.B Default\-Stop
|
|
are ignored in SuSE Linux, because the SuSE boot script concept
|
|
uses a differential link scheme (see
|
|
.IR init.d (7)).
|
|
@@ELSE_SUSE@@
|
|
The same applies for its counterpart
|
|
.B Default\-Stop
|
|
with the only difference that the script will be stopped.
|
|
.PP
|
|
Please be aware that the line
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
# Required-Stop: boot_facility_1 [ boot_facility_2 ...]
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
declares facilities which must be available during shutdown of the service
|
|
declared in the
|
|
.B Provides
|
|
tag. Same holds true for
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
# Should-Stop: boot_facility_1 [ boot_facility_2 ...]
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
which declares facilities which should be available during shutdown of
|
|
the service declared in the
|
|
.B Provides
|
|
tag. In both cases the script system should avoid stopping services
|
|
which are declared by these two Stop tags until the script including
|
|
these tags is stopped.
|
|
@@END_SUSE@@
|
|
.PP
|
|
The optional X\-Interactive keyword implies that the script using this
|
|
keyword should be started alone in a concurrent boot configuration
|
|
because it interact with the user at the console. Only the value
|
|
`true' is recognised. All others are ignored.
|
|
.PP
|
|
The optional
|
|
.B X\-Start\-Before
|
|
keyword implies that the script using this keyword
|
|
should be started
|
|
.B before
|
|
the specified service names.
|
|
Whereas the optional
|
|
.B X\-Stop\-After
|
|
keyword implies that the script using this keyword
|
|
should be stopped
|
|
.B after
|
|
the specified service names. Both implies that those
|
|
services now depend on the specifying script.
|
|
With known dependencies and runlevel(s)
|
|
.B insserv
|
|
sets and reorders the corresponding symbolic links
|
|
of the concerned runlevels
|
|
@@BEGIN_SUSE@@
|
|
directories (see \fI init.d\fR (7)).
|
|
@@ELSE_SUSE@@
|
|
directories.
|
|
@@END_SUSE@@
|
|
@@BEGIN_SUSE@@
|
|
Known runlevels are:
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
\fB0\fR\ used for System halt
|
|
\fB1\fR\ used for single user mode
|
|
\fB2\fR\ used for local multiuser without remote network
|
|
\fB3\fR\ used for full multiuser with network
|
|
\fB4\fR\ reserved for local use
|
|
\fB5\fR\ used for full multiuser with network and graphical interface
|
|
\fB6\fR\ used for System reboot
|
|
\fBS\fR\ used during boot into single user mode
|
|
\fBB\fR\ used during boot before any other runlevel
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
@@END_SUSE@@
|
|
.PP
|
|
.B insserv
|
|
scans for
|
|
.B System Facilities
|
|
in the configuration file
|
|
.I /etc/insserv.conf
|
|
and each file in the directory
|
|
.IR /etc/insserv.conf.d/ .
|
|
Each line which begins with
|
|
.B $
|
|
and a following name defines a system facility
|
|
accordingly to the Linux Standard Base Specification (LSB),
|
|
All names followed by such a system facility
|
|
will declare the required dependencies of the facility.
|
|
Here is an example for
|
|
.IR /etc/insserv.conf :
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
# All local filesystems are mounted
|
|
# (done during boot phase)
|
|
$local_fs boot
|
|
|
|
# Low level networking
|
|
$network network route
|
|
|
|
# Named is operational
|
|
$named named
|
|
|
|
# All remote filesystems are mounted
|
|
# (in some cases /usr may be remote).
|
|
$remote_fs $local_fs nfs
|
|
|
|
# System logger is operational
|
|
$syslog syslog
|
|
|
|
# All network daemons are running (This was removed in LSB 1.2)
|
|
$netdaemons portmap inetd
|
|
|
|
# Services which need to be interactive
|
|
<interactive> boot.crypto
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
Names starting with a `+' sign are marked as optional.
|
|
If the service with the name after the plus sign is
|
|
available it will be used, if not available it is
|
|
ignored silently. Words beginning with
|
|
.B <
|
|
and ending with
|
|
.B >
|
|
are keywords. Currently
|
|
.B <interactive>
|
|
is the only know keyword for marking a service
|
|
as an interactive one, e.g., a service which requires
|
|
a passphrase or password input during boot
|
|
or runlevel change. The special facility
|
|
.B $null
|
|
is used to enforce an empty dependency in case of
|
|
.B Should-Stop
|
|
and
|
|
@@BEGIN_SUSE@@
|
|
.B Required-Stop
|
|
otherwise insserv assumes the same dependencies as for the
|
|
.B Start
|
|
case.
|
|
@@ELSE_SUSE@@
|
|
.BR Required-Stop .
|
|
@@END_SUSE@@
|
|
.P
|
|
In addition to the defined
|
|
.B System Facilities
|
|
in the configuration file
|
|
.IR /etc/insserv.conf ,
|
|
.B insserv
|
|
also knows the special facility
|
|
.BR $all .
|
|
This facility indicates that a service should be inserted
|
|
at the end of all services at starting and at the very beginning
|
|
at stopping. Clearly all services using this facility will be
|
|
grouped into one starting or stopping order.
|
|
.\"
|
|
.SH OPTIONS
|
|
Currently the following options are recognized by insserv:
|
|
.TP
|
|
.BR \-v ,\ \-\-verbose
|
|
Perform operation with more diagnotic messages printed on stderr.
|
|
.TP
|
|
.BR \-q ,\ \-\-silent
|
|
Perform operations silently. This blocks warning messages
|
|
from being printed to stderr. Only fatal error messages
|
|
are printed.
|
|
.TP
|
|
.BR \-c\ <config> ,\ \-\-config\ <config>
|
|
Specify path to the insserv.conf file (by default located at /etc/insserv.conf). This is typically used
|
|
for testing purposes. insserv will automatically
|
|
check for the existance of an insserv configuration directory under this location. For example, specifying
|
|
/usr/local/etc/insserv.conf will cause insserv to also scan the directory /usr/local/etc/insserv.conf.d/
|
|
.TP
|
|
.BR \-i , \ \-\-insserv\-dir
|
|
The insserv program will try to place dependency information
|
|
in the /etc/init.d directory. When using the \-i flag, the
|
|
user can specify an alternative directory for dependency information.
|
|
This is typically used when debugging insserv.
|
|
.TP
|
|
.BR \-o\ <path> ,\ \-\-override\ <path>
|
|
LSB comment headers found in this path will override existing
|
|
LSB comment headers of scripts in the init.d directory (default path is
|
|
.IR /etc/insserv/overrides/ ).
|
|
.TP
|
|
.BR \-p\ <path> ,\ \-\-path\ <path>
|
|
Specify path to init.d directory. Useful for testing.
|
|
.TP
|
|
.BR \-n ,\ \-\-dryrun, \ \-\-dry\-run
|
|
Do not update symlinks. Does not create depend.boot, depend.start, and depend.stop
|
|
files.
|
|
.TP
|
|
.BR \-s ,\ \-\-showall, \ \-\-show\-all
|
|
Output runlevel and sequence information. Do not update symlinks.
|
|
.TP
|
|
.BR \-r ,\ \-\-remove
|
|
Remove the listed scripts from all runlevels.
|
|
.TP
|
|
.BR \-d ,\ \-\-default
|
|
Use default runlevels as defined in the scripts.
|
|
This may restore an edited runlevel link scheme.
|
|
.TP
|
|
.BR \-f ,\ \-\-force
|
|
Ignore if a required service is missed. Beside this if start and or
|
|
stop levels are specified on the command line the default levels of
|
|
the script will be ignored.
|
|
.TP
|
|
.BR \-u\ <path> ,\ \-\-upstart-job\ <path>
|
|
Path to replace existing upstart job path. (default path is
|
|
.IR /lib/init/upstart-job ).
|
|
.TP
|
|
.BR \-h ,\ \-\-help
|
|
Print out short usage message.
|
|
.PP
|
|
But you may use the argument syntax described in the
|
|
following section.
|
|
.SH ARGUMENTS
|
|
.TP
|
|
.RI [[ / ] path/to/init.d/ ]
|
|
Relative or absolute path to the init scripts base directory.
|
|
@@BEGIN_SUSE@@
|
|
For the SuSE Linux boot concept, this defaults to
|
|
@@ELSE_SUSE@@
|
|
This defaults to
|
|
@@END_SUSE@@
|
|
.I /etc/init.d/
|
|
in compliance with the LSB specification.
|
|
In this case
|
|
.B insserv
|
|
does not add or remove a script to the runlevels
|
|
declared in the script headers, but may re\-order the
|
|
runlevels if the order of the currently enabled scripts
|
|
has changed (see option
|
|
.BR \-d ).
|
|
Note that if a relative path is used
|
|
.B insserv
|
|
has to be called from the root directory.
|
|
.TP
|
|
.RI [[ / ] path/to/init.d/ ] script\ ...
|
|
List of scripts which have to be added to
|
|
the runlevels. If a path is used it
|
|
should point to the absolute or relative
|
|
location of the boot scripts.
|
|
.B insserv
|
|
checks for the existence of these scripts.
|
|
For the runlevels the information found in
|
|
the script is used.
|
|
.TP
|
|
.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1,lvl2,...> ]
|
|
List of scripts which have to be added to
|
|
the specified runlevels to be started with.
|
|
You may use this extension to override the default values
|
|
for start and stop runlevels of the script.
|
|
Note that
|
|
.BR lvl1 ,\ lvl2 ,\ ...
|
|
are the known runlevels explained above.
|
|
The extension
|
|
.I ,stop=<lvl1,lvl2,...>
|
|
is also possible.
|
|
.TP
|
|
.RI \fB\-r\fR\ [[ / ] path/to/init.d/ ] script\ ...
|
|
List of scripts which should be removed from
|
|
the runlevels. If a path is used it
|
|
should point to the absolute or relative
|
|
location of the boot scripts.
|
|
.B insserv
|
|
checks for the existence of these scripts.
|
|
.\"
|
|
.SH OVERRIDES
|
|
Beside using the extensions
|
|
.I ,start=<lvl1,lvl2,...>
|
|
and
|
|
.I ,stop=<lvl1,lvl2,...>
|
|
it is possible to use override files replace a LSB comment header
|
|
or simply provide a missing LSB comment header. This can be done
|
|
by placing a file with the new LSB comment header using the same
|
|
name as the boot or init script in the directory
|
|
.IR /etc/insserv/overrides/ .
|
|
For third party boot scripts without LSB header it is possible to
|
|
add a file with the same name in the directory
|
|
.I /usr/share/insserv/overrides/
|
|
to make them completely LSB compliant.
|
|
.\"
|
|
.SH UPSTART JOB COMPATIBILITY
|
|
To allow upstart jobs to work as init.d scripts, insserv will
|
|
recognize a symlink from path/to/init.d/script to
|
|
/lib/init/upstart-job as upstart jobs, and instead of reading the
|
|
header from the file will run the script with the argument lsb-header
|
|
to get the script header.
|
|
.SH EXIT CODES
|
|
The exit codes have the following conditions:
|
|
.RS 7
|
|
.IP 0 5
|
|
Service was successfully installed or removed
|
|
.IP 1 5
|
|
Service was not installed or removed
|
|
.RE
|
|
.SH NOTE
|
|
Please be aware that the following patterns of
|
|
boot script file names will be not accepted by
|
|
.BR insserv :
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
@@BEGIN_SUSE@@
|
|
*.local
|
|
@@END_SUSE@@
|
|
*.dpkg*
|
|
*.ucf*
|
|
*.rpm*
|
|
*.ba*
|
|
*.old
|
|
*.new
|
|
*.org
|
|
*.orig
|
|
*.save
|
|
*.swp
|
|
*.core
|
|
*~
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
with the wildcard character
|
|
.BR * .
|
|
Beside this all boot script file names beginning with one
|
|
of the following characters
|
|
.sp 1
|
|
.in +1l
|
|
.nf
|
|
$.#%_+-\e*[]^:()~
|
|
.fi
|
|
.in -1l
|
|
.sp 1
|
|
will be ignored.
|
|
Administrators can further filter files by extension in the /etc/init.d/ directory
|
|
by creating a text file called /etc/insserv/file\-filters. The file\-filters configuration
|
|
file lists (one per line) extensions which should be ignored by insserv as it parses the
|
|
/etc/init.d/ directory. An example of /etc/insserv/file\-filters might look like this:
|
|
.nf
|
|
git
|
|
svn
|
|
html
|
|
.fi
|
|
.SH BUGS
|
|
Boot scripts sometimes lack a LSB comment header. Contact a package
|
|
maintainer or developer of the software which provides the script to
|
|
have a LSB comment header added to it.
|
|
.SH FILES
|
|
.TP
|
|
.I /etc/insserv.conf
|
|
configuration file for
|
|
.B insserv
|
|
which defines the LSB System Facilities.
|
|
.TP
|
|
.I /etc/insserv.conf.d/
|
|
directory for further configuration files for declaring
|
|
LSB System Facilities.
|
|
.TP
|
|
.I /etc/insserv/overrides/
|
|
path to replace existing LSB comment headers with the comment
|
|
headers found in this path.
|
|
.TP
|
|
.I /etc/insserv/file\-filters
|
|
configuration file which lists file extensions (one per line) we should ignore
|
|
when parsing the init.d directory.
|
|
.TP
|
|
.I /etc/init.d/
|
|
path to the
|
|
@@BEGIN_SUSE@@
|
|
SuSE
|
|
@@END_SUSE@@
|
|
init script base directory as
|
|
required by the Linux Standard Base Specification (LSB).
|
|
.PP
|
|
.IR /etc/init.d/.depend.boot ,
|
|
.br
|
|
.IR /etc/init.d/.depend.start ,
|
|
.br
|
|
.I /etc/init.d/.depend.stop
|
|
.in +\n(INu
|
|
The
|
|
.BR make (1)
|
|
like dependency files produced by
|
|
.B insserv
|
|
for
|
|
.IR booting ", " starting ", and " stopping
|
|
with the help of
|
|
.BR startpar (1).
|
|
.\"
|
|
.SH SEE ALSO
|
|
@@BEGIN_SUSE@@
|
|
.BR init.d (7),
|
|
@@END_SUSE@@
|
|
.BR init (8),
|
|
@@BEGIN_SUSE@@
|
|
.BR startproc (8),
|
|
.BR checkproc (8),
|
|
.BR killproc (8),
|
|
@@END_SUSE@@
|
|
.BR startpar (1).
|
|
.SH COPYRIGHT
|
|
2000\(en2009 Werner Fink,
|
|
.br
|
|
2009 SuSE Linux Products GmbH Nuernberg, Germany.
|
|
.br
|
|
2000\(en2003 SuSE GmbH Nuernberg, Germany,
|
|
.br
|
|
2007\(en2009 SuSE Linux Products GmbH Nuernberg, Germany.
|
|
.br
|
|
2019\(en Jesse Smith
|
|
.SH AUTHOR
|
|
Werner Fink <feedback@suse.de>
|
|
.SH CONTRIBUTORS
|
|
Petter Reinholdtsen
|
|
.br
|
|
Kel Modderman
|