]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/initctl.8
Imported from util-linux-2.10s tarball.
[thirdparty/util-linux.git] / login-utils / initctl.8
1 .\" Copyright (C) 2000 Richard Gooch
2 .\"
3 .\" This program is free software; you can redistribute it and/or modify
4 .\" it under the terms of the GNU General Public License as published by
5 .\" the Free Software Foundation; either version 2 of the License, or
6 .\" (at your option) any later version.
7 .\"
8 .\" This program is distributed in the hope that it will be useful,
9 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 .\" GNU General Public License for more details.
12 .\"
13 .\" You should have received a copy of the GNU General Public License
14 .\" along with this program; if not, write to the Free Software
15 .\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 .\"
17 .\" Richard Gooch may be reached by email at rgooch@atnf.csiro.au
18 .\" The postal address is:
19 .\" Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
20 .\"
21 .\" initctl.8 Richard Gooch 6-NOV-2000
22 .\"
23 .TH INITCTL 8 "6 Nov 2000" "Util-Linux Package"
24 .SH NAME
25 initctl \- utility to control simpleinit(8)
26 .SH SYNOPSIS
27 .nf
28 \fBneed\fP [\fB-r\fP] \fBservice\fP
29 .BR display-services
30 \fBprovide service\fP
31 .fi
32 .SH OVERVIEW
33 The \fBneed\fP programme is designed to help improve the robustness,
34 scalability and readability of system boot scripts. It is now possible
35 to write a modularised set of boot scripts without the complex and
36 fragile numbered symlink scheme used in SysV-style boot scripts. Each
37 script can simply declare, using \fBneed\fP(8), what must run before
38 them.
39 .SH DESCRIPTION for need
40 The \fBneed\fP programme is a utility that tells \fBsimpleinit\fP(8)
41 to start a \fIservice\fP (usually a script in \fI/sbin/init.d\fP) and
42 will wait for the service to become available. If the service is
43 already available, it will not be started again.
44
45 The \fB-r\fP option is used to tell \fBsimpleinit\fP(8) to "roll back"
46 (stop) services up to (but not including) \fIservice\fP. If
47 \fIservice\fP is not specified, all services are stopped. The \fB-r\fP
48 option thus allows the system to be partially or wholly shut down in
49 an orderly fashion. The \fBshutdown\fP(8) programme still needs to be
50 run.
51
52 .SH DESCRIPTION for display-services
53 When invoked as \fBdisplay-services\fP it will write the list of
54 currently available services and the list of failed services to the
55 standard output.
56
57 .SH DESCRIPTION for provide
58 When invoked as \fBprovide\fP it tells \fBsimpleinit\fP(8) that the
59 parent (calling) process will be providing a service with name
60 \fIservice\fP. If the calling process exits successfully (status 0)
61 the service is deemed to be available. Only one instance of
62 \fIservice\fP may be started, so alternate providers will block and
63 may fail.
64
65 Using \fBprovide\fP it is possible to have multiple potential
66 providers for the same (generic) service (e.g. \fBsendmail\fP and
67 \fBqmail\fP both provide a \fBmta\fP service), where only one actually
68 provides the service. This may be used by service startup scripts
69 which check for configuration files.
70 .SH EXIT CODE
71 The exit code from \fBneed\fP is 0 if the service was successfully
72 started, 1 if the service failed badly, and 2 if the service is
73 unavailable (i.e. disabled in configuration files). These exit codes
74 reflect the exit codes from the service startup scripts.
75
76 The exit code from \fBneed -r\fP is 0 if the service was successfully
77 stopped, 1 if the service could not be stopped, and 2 if the service
78 was not available to start with. The service shutdown scripts may only
79 return 0 (for success) or 1 (for failure).
80
81 The exit code from \fBprovide\fP is 0 if the service may be provided,
82 1 if it may not, and 2 if the parent process is not a child of
83 init. It may block waiting for another provider which is initialising
84 the service.
85 .SH SIGNALS
86 \fBneed\fP(8) uses \fBSIGUSR1\fP, \fBSIGUSR2\fP and \fBSIGPOLL\fP for
87 communication with \fBsimpleinit\fP(8). Don't send these signals to
88 it.
89 .SH FILES
90 .PD 0
91 .TP 20
92 .BI /dev/initctl
93 This is the control FIFO, created by \fBsimpleinit\fP(8), which
94 \fBneed\fP(8) writes commands to.
95 .SH SEE ALSO
96 .BR simpleinit (8),
97 .BR init (8)
98 .PP
99 A more complete discussion of the new boot script system, based on
100 \fBneed\fP(8), is available from:
101 http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/
102 .SH AUTHOR
103 Richard Gooch (rgooch@atnf.csiro.au)
104 .SH AVAILABILITY
105 The Util-Linux package is available from:
106 ftp://ftp.??.kernel.org/pub/linux/utils/util-linux/