Product SiteDocumentation Site

F.2.5. ジョブの定義

Previously, the sysvinit package provided the init daemon for the default configuration. When the system started, this init daemon ran the /etc/inittab script to start system processes defined for each runlevel. The default configuration now uses an event-driven init daemon provided by the Upstart package. Whenever particular events occur, the init daemon processes jobs stored in the /etc/event.d directory. The init daemon recognizes the start of the system as such an event.
各ジョブは通常、プログラムを1つ指定し、そのプログラムを開始/停止する為の init を引き起こすイベントを指定します。一部の ジョブは タスク として構築されており、これはアクションを 実行して、その後は他のイベントがジョブを再度引き起こすまで停止します。その他のジョブは サービス として構築されていて、これは他のイベント(又は ユーザー)がそれを止めるまで init が実行を続けます。
For example, the /etc/events.d/tty2 job is a service to maintain a virtual terminal on tty2 from the time that the system starts until the system shuts down, or another event (such as a change in runlevel) stops the job. The job is constructed so that init will restart the virtual terminal if it stops unexpectedly during that time:
# tty2 - getty
# This service maintains a getty on tty2 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on started prefdm

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

exec /sbin/mingetty tty2