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 |
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.
SYNTAX | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Event files can contain the following stanzaz.
When the event is started by init, execute the following arguments.
Example: exec /bin/dbus-daemon --system
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 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.
The format is similar to pre-start.
The format is similar to pre-start.
The format is similar to pre-start.
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.
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.
fork in the background and that its PID needs to be obtained.
The respawn flag means that the process will be restarted when it ends.
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 is implied by the respawn flag.
it is started, even if there is another instance running. It is the converse of daemon.
time seconds.
prevent a respawn of the process.
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
Example: env LD_LIBRARY_PATH=/opt/app/lib
Example: umask 0755
Example: nice 5
Example: chroot /var/empty
Example: chdir /var/tmp
Examples: limit nproc 10 limit core unlimited
Example: descripton "This is a test job."
Example: author "Obi-wan Kennedy <bidy@whitehouse.gov>"
Example: version "0.0.0.0.1 test"
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.
No jobs are running and no events are pending.
Control-Alt-Delete has been pressed.
A kbdrequest event has occurred.
Init received SIGPWR.
The given job is being started.
The given job has successfully been started.
The given job is being stopped.
The given job has been stopped successfully.
Emitted when the system boots.
Init has been asked to move to the given runlevel.
FILES | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
SEE ALSO | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Sommaire | Début | Suivant | Sommaire | Préc.page.lue | Accueil |
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-delete | EVENTS |
daemon | SYNTAX |
description <text> | SYNTAX |
emits <signals> | SYNTAX |
env <name>=<value> | SYNTAX |
exec <command> <arguments> | SYNTAX |
instance | SYNTAX |
kbdrequest | EVENTS |
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-start | SYNTAX |
post-stop | SYNTAX |
power-status-changed | EVENTS |
pre-start | SYNTAX |
pre-stop | SYNTAX |
respawn | SYNTAX |
respawn limit [count [timeout]] | SYNTAX |
runlevel <runlevel> | EVENTS |
script ... | SYNTAX |
service | SYNTAX |
stalled | EVENTS |
start on <event> | SYNTAX |
started <job> | EVENTS |
starting <job> | EVENTS |
startup | EVENTS |
stop on <event> | SYNTAX |
stopped <job> | EVENTS |
stopping <job> | EVENTS |
umask <umask> | SYNTAX |
version <version> | SYNTAX |