📄 initctl.8
字号:
.\" Copyright (C) 2000-2001 Richard Gooch.\".\" 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., 675 Mass Ave, Cambridge, MA 02139, USA..\".\" Richard Gooch may be reached by email at rgooch@atnf.csiro.au.\" The postal address is:.\" Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia..\".\" initctl.8 Richard Gooch 21-FEB-2001.\".TH INITCTL 8 "21 Feb 2001" "Util-Linux Package".SH NAMEinitctl \- utility to control simpleinit(8).SH SYNOPSIS.nf\fBneed\fP [\fB-r\fP] \fBservice\fP.BR display-services\fBprovide service\fP.fi.SH OVERVIEWThe \fBinitctl\fP programme is designed to help improve therobustness, scalability and readability of system boot scripts. It isnow possible to write a modularised set of boot scripts without thecomplex and fragile numbered symlink scheme used in SysV-style bootscripts. Each script can simply declare, using \fBneed\fP(8), whatmust run before them..SH DESCRIPTION for needThe \fBneed\fP programme is a utility that tells \fBsimpleinit\fP(8)to start a \fIservice\fP (usually a script in \fI/sbin/init.d\fP) andwill wait for the service to become available. If the service isalready available, it will not be started again.The \fB-r\fP option is used to tell \fBsimpleinit\fP(8) to "roll back"(stop) services up to (but not including) \fIservice\fP. If\fIservice\fP is not specified, all services are stopped. The \fB-r\fPoption thus allows the system to be partially or wholly shut down inan orderly fashion. The \fBshutdown\fP(8) programme still needs to berun..SH DESCRIPTION for display-servicesWhen invoked as \fBdisplay-services\fP it will write the list ofcurrently available services and the list of failed services to thestandard output..SH DESCRIPTION for provideWhen invoked as \fBprovide\fP it tells \fBsimpleinit\fP(8) that theparent (calling) process will be providing a service with name\fIservice\fP. If the calling process exits successfully (status 0)the service is deemed to be available. Only one instance of\fIservice\fP may be started, so alternate providers will block andmay fail.Using \fBprovide\fP it is possible to have multiple potentialproviders for the same (generic) service (e.g. \fBsendmail\fP and\fBqmail\fP both provide a \fBmta\fP service), where only one actuallyprovides the service. This may be used by service startup scriptswhich check for configuration files..SH EXIT CODEThe exit code from \fBneed\fP is 0 if the service was successfullystarted, 1 if the service failed badly, and 2 if the service isunavailable (i.e. disabled in configuration files). These exit codesreflect the exit codes from the service startup scripts.The exit code from \fBneed -r\fP is 0 if the service was successfullystopped, 1 if the service could not be stopped, and 2 if the servicewas not available to start with. The service shutdown scripts may onlyreturn 0 (for success) or 1 (for failure).The exit code from \fBprovide\fP is 0 if the service may be provided,1 if it may not, and 2 if the parent process is not a child ofinit. It may block waiting for another provider which is initialisingthe service..SH SIGNALS\fBinitctl\fP(8) uses \fBSIGUSR1\fP, \fBSIGUSR2\fP and \fBSIGPOLL\fPfor communication with \fBsimpleinit\fP(8). Don't send these signalsto it..SH FILES.PD 0.TP 20.BI /dev/initctlThis is the control FIFO, created by \fBsimpleinit\fP(8), which\fBinitctl\fP(8) writes commands to..SH SEE ALSO.BR simpleinit (8),.BR init (8).PPA more complete discussion of the new boot script system, based on\fBneed\fP(8), is available from:http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/.SH AUTHORRichard Gooch (rgooch@atnf.csiro.au).SH AVAILABILITYThe Util-Linux package is available from:ftp://ftp.??.kernel.org/pub/linux/utils/util-linux/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -