Upload Tizen:Base source
[framework/base/util-linux-ng.git] / login-utils / initctl.8
1 .\" Copyright (C) 2000-2001  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   21-FEB-2001
22 .\"
23 .TH INITCTL 8 "21 Feb 2001" "Util-Linux Package"
24 .SH NAME
25 initctl \- utility to control simpleinit(8)
26 .SH SYNOPSIS
27 .B need
28 .RB [ \-r ]
29 .I service
30 .br
31 .B display-services
32 .br
33 .B provide
34 .I service
35 .SH OVERVIEW
36 The \fBinitctl\fP programme is designed to help improve the
37 robustness, scalability and readability of system boot scripts. It is
38 now possible to write a modularised set of boot scripts without the
39 complex and fragile numbered symlink scheme used in SysV-style boot
40 scripts. Each script can simply declare, using \fBneed\fP(8), what
41 must run before them.
42 .SH DESCRIPTION for need
43 The \fBneed\fP programme is a utility that tells \fBsimpleinit\fP(8)
44 to start a \fIservice\fP (usually a script in \fI/sbin/init.d\fP) and
45 will wait for the service to become available. If the service is
46 already available, it will not be started again.
47
48 The \fB-r\fP option is used to tell \fBsimpleinit\fP(8) to "roll back"
49 (stop) services up to (but not including) \fIservice\fP. If
50 \fIservice\fP is not specified, all services are stopped. The \fB-r\fP
51 option thus allows the system to be partially or wholly shut down in
52 an orderly fashion. The \fBshutdown\fP(8) programme still needs to be
53 run.
54
55 .SH DESCRIPTION for display-services
56 When invoked as \fBdisplay-services\fP it will write the list of
57 currently available services and the list of failed services to the
58 standard output.
59
60 .SH DESCRIPTION for provide
61 When invoked as \fBprovide\fP it tells \fBsimpleinit\fP(8) that the
62 parent (calling) process will be providing a service with name
63 \fIservice\fP. If the calling process exits successfully (status 0)
64 the service is deemed to be available. Only one instance of
65 \fIservice\fP may be started, so alternate providers will block and
66 may fail.
67
68 Using \fBprovide\fP it is possible to have multiple potential
69 providers for the same (generic) service (e.g. \fBsendmail\fP and
70 \fBqmail\fP both provide a \fBmta\fP service), where only one actually
71 provides the service. This may be used by service startup scripts
72 which check for configuration files.
73 .SH EXIT CODE
74 The exit code from \fBneed\fP is 0 if the service was successfully
75 started, 1 if the service failed badly, and 2 if the service is
76 unavailable (i.e. disabled in configuration files). These exit codes
77 reflect the exit codes from the service startup scripts.
78
79 The exit code from \fBneed -r\fP is 0 if the service was successfully
80 stopped, 1 if the service could not be stopped, and 2 if the service
81 was not available to start with. The service shutdown scripts may only
82 return 0 (for success) or 1 (for failure).
83
84 The exit code from \fBprovide\fP is 0 if the service may be provided,
85 1 if it may not, and 2 if the parent process is not a child of
86 init. It may block waiting for another provider which is initialising
87 the service.
88 .SH SIGNALS
89 \fBinitctl\fP(8) uses \fBSIGUSR1\fP, \fBSIGUSR2\fP and \fBSIGPOLL\fP
90 for communication with \fBsimpleinit\fP(8). Don't send these signals
91 to it.
92 .SH FILES
93 .PD 0
94 .TP 20
95 .BI /dev/initctl
96 This is the control FIFO, created by \fBsimpleinit\fP(8), which
97 \fBinitctl\fP(8) writes commands to.
98 .SH SEE ALSO
99 .BR simpleinit (8),
100 .BR init (8)
101 .PP
102 A more complete discussion of the new boot script system, based on
103 \fBneed\fP(8), is available from:
104 http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/
105 .SH AUTHOR
106 Richard Gooch (rgooch@atnf.csiro.au)
107
108 .SH AVAILABILITY
109 The initctl command is part of the util-linux-ng package and is available from
110 ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.