Usage: initctl [OPTION]... COMMAND [OPTION]... [ARG]...
Options:
--system use D-Bus system bus to connect to init daemon
--dest=NAME destination well-known name on system bus
-q, --quiet reduce output to errors only
-v, --verbose increase output to include informational messages
--help display this help and exit
--version output version information and exit
For a list of commands, try `initctl help'.
Report bugs at
Usage: initctl [OPTION]... COMMAND [OPTION]... [ARG]...
Options:
--system use D-Bus system bus to connect to init daemon
--dest=NAME destination well-known name on system bus
-q, --quiet reduce output to errors only
-v, --verbose increase output to include informational messages
--help display this help and exit
--version output version information and exit
For a list of commands, try `initctl help'.
Report bugs at
INITCTL(8) INITCTL(8) 名前 initctl - simpleinit(8) を制御するためのユーティリティ 書式 need [-r] service display-services provide service 概略 initctl プログラムは、システム起動スクリプトの堅牢さ・拡張性・可読性を 向上するためにデザインされている。現在では、SysV 形式の起動スクリプトで 使 われている複雑で脆い多くのシンボリックリンクによる方法を使うことなく 、モジュール化した起動スクリプトを書くことができる。各スクリプトは、 そ れを起動する前に何が必要かを need(8) を使って簡単に宣言できる。 need の説明 need プログラムは、simpleinit(8) に対して service (通常は /sbin/init.d 内のスクリプト) を開始するように指示し、その service が使用可能になるま で待たせるためのユーティリティである。 service が既に使用可能な場合、再 び起動されることはない。 -r オプションは、simpleinit(8) に対して service までのサービスを「押 し 戻す (roll back)」(停止する) ように指示する (指定されたサービスは含まな い)。 service が指定されない場合、全てのサービスを停止する。よって 、-r オ プションにより、システムを部分的または全体的に順序立ててシャットダウ ンすることができる。実行するためには、未だに shutdown(8) プログラムが必 要とされる。 display-services の説明 display-services として起動された場合、現在使用可能なサービスのリストと 失敗したサービスのリストを標準出力に書き出す。 provide の説明 provide として起動された場合、 simpleinit(8) に対して親プロセス (呼び出 したプロセス) が service という名前のサービスを提供するように指示する。 呼び出したプロセスが正常に (ステータス 0 で) 終了した場合、サービスが使 用 可能であると考えられる。 service のインスタンスは 1 つだけ起動される ので、他にこのサービスを提供するプログラムはブロックされて失敗する。 provide を使うことにより、同じ (一般的な) サービスを提供できる複数の プ ロ グラムを持つことができる (例えば sendmail と qmail は共に mta サービ スを提供する)。ここで、実際にサービスを提供するのは 1 つだけである。 こ れ は設定ファイルをチェックするサービス起動スクリプトで使うことができる 。 終了コード サービスが正常に起動した場合、 need からの終了コードは 0 である。サービ スが失敗した場合は 1 である。サービスが使用不能の場合 (つまり、設定ファ イルで不可にされている場合) は 2 である。これらの終了コードは、サービス 起動スクリプトからの終了コードを反映する。 サ ービスが正常に停止した場合、 need -r からの終了コードは 0 である。サ ービスが停止できなかった場合は 1 である。サービスが開始できなかった場合 は 2 である。サービスのシャットダウンスクリプトは、 (正常な場合の) 0 と (失敗の場合の) 1 しか返さない。 サービスが提供できた場合、provide の終了コードは 0 である。提供できなか っ た場合は 1 である。親プロセスが init の子でない場合は 2 である。この プログラムは、そのサービスを初期化する他のサービス提供プログラムをブ ロ ックして待たせる。 シグナル initctl(8) は simpleinit(8) と通信するために SIGUSR1, SIGUSR2, SIGPOLL を使う。これらのシグナルを need(8) に送ってはならない。 ファイル /dev/initctl simpleinit(8) によって作成される制 御 FIFO で 、 initctl(8) がコマンドを書き込む。 関連項目 simpleinit(8), init(8) need(8) を使った新しいブートスクリプトシステムについてのもっと全面的な 議論は、 http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/ で閲覧 で きる。 著者 Richard Gooch (rgooch@atnf.csiro.au) 入手先 Util-Linux パッケージは ftp://ftp.??.kernel.org/pub/linux/utils/util- linux/ から入手可能である。 Util-Linux Package 21 Feb 2001 INITCTL(8)
initctl(8) initctl(8)
NAME
initctl - init daemon control tool
SYNOPSIS
initctl [OPTION]... COMMAND [OPTION]... ARG...
DESCRIPTION
initctl allows a system administrator to communicate and interact with
the Upstart init(8) daemon.
When run as initctl, the first non-option argument is the COMMAND.
Global options may be specified before or after the command.
You may also create symbolic or hard links to initctl named after com-
mands. When invoked through these links the tool will behave only as
that command, with global and command-specific options intermixed. The
default installation supplies such links for the start, stop, restart,
reload and status commands.
OPTIONS
--system
Communication with the init(8) daemon is normally performed over
a private socket connection. This has the advantage of speed
and robustness, when issuing commands to start or stop services
or even reboot the system you do not want to be affected by
changes to the D-Bus system bus daemon.
The disadvantage to using the private socket however is secu-
rity, init(8) only permits the root user to communicate over
this socket which means that read-only commands such as status
and list cannot be made by other users.
The --system option instructs initctl to communicate via the D-
Bus system bus rather than over the private socket.
This is only possible if the system bus daemon is running and if
init(8) is connected to it. The advantage is that the default
security configuration allows non-root users to use read-only
commands.
--dest Specifies the well-known name of the init(8) daemon when using
--system.
There is normally no need to use this option since the init(8)
daemon uses the default com.ubuntu.Upstart name. However it may
be useful for debugging.
--no-wait
Applies to the start, stop, restart and emit commands.
Normally initctl will wait for the command to finish before
returning.
For the start, stop and restart commands, finishing means that
the named job is running (or has finished for tasks) or has been
fully stopped.
For the emit command, finishing means that all of the jobs
affected by the event are running (or have finished for tasks)
or have been fully stopped.
This option instead causes these commands to only wait for the
goal change or event to be queued.
--quiet
Reduces output of all commands to errors only.
COMMANDS
start JOB [KEY=VALUE]...
Requests that a new instance of the named JOB be started, out-
putting the status of the job to standard output when the com-
mand completes.
See status for a description of the output format.
The optional KEY=VALUE arguments specify environment variables
to be passed to the starting job, and placed in its environment.
They also serve to specify which instance of multi-instance jobs
should be started.
Most jobs only permit a single instance; those that use the
instance stanza in their configuration define a string expanded
from environment variables to name the instance. As many unique
instances may be started as unique names may be generated by the
stanza. Thus the environment variables also serve to select
which instance of JOB is to be acted upon.
If the job is already running, start will return an error.
stop JOB [KEY=VALUE]...
Requests that an instance of the named JOB be stopped, out-
putting the status of the job to standard output when the com-
mand completes.
See status for a description of the output format and start for
a discussion on instances.
restart
JOB [KEY=VALUE]...
Requests that an instance of the named JOB be restarted, out-
putting the status of the job to standard output when the com-
mand completes.
See status for a description of the output format and start for
a discussion on instances.
Note that this command can only be used when there is an
instance of JOB, if there is none then it returns an error
instead of starting a new one.
reload JOB [KEY=VALUE]...
Sends the SIGHUP signal to running process of the named JOB
instance.
See start for a discussion on instances.
status JOB [KEY=VALUE]...
Requests the status an instance of the named JOB, outputting to
standard output.
See start for a discusson on instances.
For a single-instance job a line like the following is output:
job start/running, process 1234
The job name is given first followed by the current goal and
state of the selected instance. The goal is either start or
stop, the status may be one of waiting, starting, pre-start,
spawned, post-start, running, pre-stop, stopping, killed or
post-stop.
If the job has an active process, the process id will follow on
the same line. If the state is pre-start or post-stop this will
be the process id of the equivalent process, otherwise it will
be the process id of the main process.
job start/pre-start, process 902
The post-start and pre-stop states may have multiple processes
attached, the extra processes will follow on consecutive lines
indented by a tab:
job start/post-start, process 1234
post-start process 1357
If there is no main process, they may follow on the same line
but will be prefixed to indicate that it is not the main process
id being given:
job start/post-start, (post-start) process 1357
Jobs that permit multiple instances have names for each
instance, the output is otherwise identical to the above except
that the instance name follows the job name in parentheses:
job (tty1) start/post-start, process 1234
post-start process 1357
list Requests a list of the known jobs and instances, outputs the
status of each to standard output.
See status for a description of the output format and start for
a discussion on instances.
No particular order is used for the output, and there is no dif-
ference in the output (other than the instance name appearing in
parentheses) between single-instance and multiple-instance jobs.
emit EVENT [KEY=VALUE]...
Requests that the named EVENT be emitted, potentially causing
jobs to be started and stopped depending on their use of the
start on and stop on stanzas in their configuration.
The optional KEY=VALUE arguments specify environment variables
to be included with the event and thus exported into the envi-
ronment of any jobs started and stopped by the event.
The environment may also serve to specify which instance of
multi-instance jobs should be started or stopped. See start for
a discussion on instances.
There is no limitation on the event names that may be emitted
with this command, you are free to invent new events and use
them in your job configurations.
The most well known event used by the default Upstart configura-
tion is the runlevel(7) event. This is normally emitted by the
telinit(8) and shutdown(8) tools.
reload-configuration
Requests that the init(8) daemon reloads its configuration.
This command is generally not necessary since init(8) watches
its configuration directories with inotify(7) and automatically
reloads in cases of changes.
No jobs will be started by this command.
version
Requests and outputs the version of the running init daemon.
log-priority
[PRIORITY]
When called with a PRIORITY argument, it requests that the
init(8) daemon log all messages with that priority or greater.
This may be used to both increase and decrease the volume of
logged messages.
PRIORITY may be one of debug, info, message, warn, error or
fatal.
When called without argument, it requests the current minimum
message priority that the init(8) daemon will log and ouputs to
standard output.
usage
JOB [KEY=VALUE]...
Show usage information an instance of the named JOB defined with usage stanza.
For job with usage stanza a line like the following is output, see init(5) :
Usage: tty DEV=ttyX - where X is console id
AUTHOR
Written by Scott James Remnant
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa