events   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

Section: File Formats (5)
Updated: April 2008
Sommaire  




NAME   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

events - format of event files used by the upstart init system  




DESCRIPTION   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

upstart works on the basis of event files that describe jobs that should be managed. This includes the particulars about what binary or shell script code should executed while the job is running, and which events can cause the job to be started or stopped.

Event files are stored in the /etc/event.d directory.  




SYNTAX   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

Event files can contain the following stanzaz.

exec <command> <arguments>

When the event is started by init, execute the following arguments.

Example: exec /bin/dbus-daemon --system

script ...

Like exec but instead of executing a single program, execute the following shell code. script sections are closed with a end script marker.

Example:

        script
                rm -f /var/run/sshd.pid
                sshd
        end script

Only one of  exec and script can be used at a time. If both
are bspecifed, exec takes priority.

pre-start

pre-start can be invoked as pre-start exec or pre-start script in the same way that a start action can be handled by either exec or script.

post-start

The format is similar to pre-start.

pre-stop

The format is similar to pre-start.

post-stop

The format is similar to pre-start.

start on <event>

section, the job can only be manually started with the initctl(8) command. Examples: start on startup This starts immediately after boot. start on stopped rc3 This starts when the 'rc3' event has stopped. Events are matched via globbing. So a stanza of the form start on runlevel [2345] would match any of runlevels 2, 3, 4, or 5.

stop on <event>

section, the job can only be manually stopped with the initctl command. Examples: stop on runlevel 0 This stops the job when runlevel 0 is entered. stop on stopping dbus ok This stops the job when the 'dbus' job is stopped. Events are matched via globbing. So a stanza of the form stop on runlevel [!5] would match any runlevel other than 5.

daemon

fork in the background and that its PID needs to be obtained.

respawn

The respawn flag means that the process will be restarted when it ends.

respawn limit [count [timeout]]

if the respawn flag is set for the job; setting a limit does not automatically set respawning capability. If the process is respawned more than count times within an interval of timeout seconds, the job will be stopped automatically, andn ot restarted. The limit defaults to 10 times within 5 seconds.

Example: respawn limit 10 120 This sets the limit for respawn to ten times within two minutes, the historical behavior for System V init.

service

service is implied by the respawn flag.

instance

it is started, even if there is another instance running. It is the converse of daemon.

kill timeout <time>

time seconds.

normal exit <status>

prevent a respawn of the process.

console {logged|output|owner|none}

logged Redirect to logger. (the default setting) output Direct to the current stdout owner The process becomes the owner of the console, allowing it to receive signals from the keyboard none Output is redirected to /dev/null

env <name>=<value>

Example: env LD_LIBRARY_PATH=/opt/app/lib

umask <umask>

Example: umask 0755

nice <value>

Example: nice 5

chroot <path>

Example: chroot /var/empty

chdir <path>

Example: chdir /var/tmp

limit {as|core|cpu|data|fsize|memlock|msgqueue|nice|nofile|nproc|rss|rtprio|sigpending|stack} {unlimited|<value>}

Examples: limit nproc 10 limit core unlimited

description <text>

Example: descripton "This is a test job."

author <text>

Example: author "Obi-wan Kennedy <bidy@whitehouse.gov>"

version <version>

Example: version "0.0.0.0.1 test"

emits <signals>

any init(8) tools. For more information on signals, see the initctl(8) man page and the emit option. Example: emits spam egg ham

 



events   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

A wide array of events can be emitted by the system (see initctl(8)) but the following events are generated by upstart itself, or are usually seen on a typical install.

stalled

No jobs are running and no events are pending.

control-alt-delete

Control-Alt-Delete has been pressed.

kbdrequest

A kbdrequest event has occurred.

power-status-changed

Init received SIGPWR.

starting <job>

The given job is being started.

started <job>

The given job has successfully been started.

stopping <job>

The given job is being stopped.

stopped <job>

The given job has been stopped successfully.

startup

Emitted when the system boots.

runlevel <runlevel>

Init has been asked to move to the given runlevel.

 



FILES   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

/etc/event.d The directory where event files are stored.  




SEE ALSO   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

initctl(8) telinit(8) init(8) http://upstart.ubuntu.com/getting-started.html


 



Sommaire   Début   Suivant   Sommaire   Préc.page.lue   Accueil

NAME

DESCRIPTION

SYNTAX

EVENTS

FILES

SEE ALSO


Table des mots clés   Début   Suivant   Sommaire   Préc.page.lue   Accueil
author <text>SYNTAX
chdir <path>SYNTAX
chroot <path>SYNTAX
console {logged|output|owner|none}SYNTAX
control-alt-deleteEVENTS
daemonSYNTAX
description <text>SYNTAX
emits <signals>SYNTAX
env <name>=<value>SYNTAX
exec <command> <arguments>SYNTAX
instanceSYNTAX
kbdrequestEVENTS
kill timeout <time>SYNTAX
limit {as|core|cpu|data|fsize|memlock|msgqueue|nice|nofile|nproc|rss|rtprio|sigpending|stack} {unlimited|<value>}SYNTAX
nice <value>SYNTAX
normal exit <status>SYNTAX
post-startSYNTAX
post-stopSYNTAX
power-status-changedEVENTS
pre-startSYNTAX
pre-stopSYNTAX
respawnSYNTAX
respawn limit [count [timeout]]SYNTAX
runlevel <runlevel>EVENTS
script ...SYNTAX
serviceSYNTAX
stalledEVENTS
start on <event>SYNTAX
started <job>EVENTS
starting <job>EVENTS
startupEVENTS
stop on <event>SYNTAX
stopped <job>EVENTS
stopping <job>EVENTS
umask <umask>SYNTAX
version <version>SYNTAX



Ce document a été créé par man2html suivi de man2html.pl, le 02/03/2009 15:35:06, en utilisant les pages de 'man'.
 

Valid HTML 4.01 Transitional