~vorlon/ubuntu/raring/upstart/lp.1199778

« back to all changes in this revision

Viewing changes to init/man/init.5

  • Committer: Stéphane Graber
  • Date: 2013-03-07 18:43:01 UTC
  • mfrom: (1182.56.54 upstart)
  • Revision ID: stgraber@ubuntu.com-20130307184301-dlmb1c5bwonqagkw
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH init 5 2011-05-12 "Upstart"
 
1
.TH init 7 2013-01-25 "Upstart"
2
2
.\"
3
3
.SH NAME
4
4
init \- Upstart init daemon job configuration
9
9
Default location of system job configuration files.
10
10
.\"
11
11
.TP
 
12
.B $XDG_CONFIG_HOME/upstart/, $XDG_CONFIG_DIRS/upstart/
 
13
Default locations of user session job configuration files.
 
14
.\"
 
15
.TP
12
16
.B $HOME/.init/
13
 
Default location of user job configuration files.
 
17
Deprecated location of user job configuration files (still
 
18
honoured by User Session Mode).
14
19
.\"
15
20
.SH DESCRIPTION
16
21
On startup, the Upstart
20
25
directory, and watches for future changes to these files using
21
26
.BR inotify (7).
22
27
 
23
 
If D\-Bus has been configured to allow non\-privileged users to invoke all
24
 
Upstart D\-Bus methods, Upstart is also able to manage User Jobs. See
25
 
.B User Jobs
 
28
If Upstart was invoked as a user process with \-\-user option, it will
 
29
run in User Session mode. See
 
30
.B User Session Mode
26
31
for further details.
27
32
 
28
33
To be considered by Upstart, files in this directory must have a
76
81
 
77
82
Configuration files are plain text and should not be executable.
78
83
.\"
79
 
.SS User Jobs
80
 
 
81
 
A User Job is a job configuration file created by a non\-privileged user
82
 
in their
83
 
.B $HOME/.init/
84
 
directory. Job configuration files in this directory have the same
85
 
syntax as system job configuration files.
86
 
Files in this directory will be read and an
87
 
.BR inotify (7)
88
 
watch created the first time a user runs 
89
 
.BR initctl (8) "."
90
 
 
91
 
Any user can create user jobs, but that user can control
92
 
.I only
93
 
jobs they create.
94
 
 
95
 
Users are able to manage their jobs using the standard
96
 
.BR initctl (8)
97
 
facility.
98
 
 
99
 
Note that stanzas which manipulate resources limits may cause a job to
100
 
fail to start should the value provided to such a stanza attempt to
101
 
exceed the maximum value the users privilege level allows.
102
 
 
103
 
Note that a user job configuration file cannot have the same name as a
104
 
system job configuration file.
105
 
.\"
106
84
.SS Chroot Support
107
85
 
108
86
Upstart is able to manage jobs within a \fBchroot\fP(2). To control jobs
115
93
.B Process environment
116
94
below).
117
95
 
118
 
Note too that User Jobs can be created within a chroot environment.
 
96
.\"
 
97
.SS User Session Mode
 
98
 
 
99
Upstart can manage complete User Sessions. In this mode it runs with a
 
100
process id greater than 1 and will read job configuration files from the
 
101
following list of directories in the order shown:
 
102
 
 
103
.IP \(bu 4
 
104
.I $XDG_CONFIG_HOME/upstart/
 
105
.IP \(bu 4
 
106
.I $HOME/.init/
 
107
.IP \(bu 4
 
108
.I $XDG_CONFIG_DIRS/upstart/
 
109
.IP \(bu 4
 
110
.I /usr/share/upstart/sessions/
 
111
.P
 
112
 
 
113
Note that the first directory to contain a job is considered the owner
 
114
of that job name: any subsequently searched directory that contains a
 
115
job of the same name will be ignored. The same applies for override
 
116
files: only the first override file found in the search order will be
 
117
applied. Note that an override file can be in the same directory or
 
118
earlier to that directory which contains the job file.
 
119
 
 
120
Jobs in these locations are expected to launch the user's session.
 
121
Upstart will try to parent all spawned process with the aid of
 
122
.BR prctl (2) "" .
 
123
If successful this will ensure that even double-forking daemons will be
 
124
reparented to the User Session process, and not to the
 
125
.BR init (8)
 
126
daemon running with process id 1.
 
127
 
 
128
When running in User Session mode, Upstart will kill all job processes
 
129
on session logout or shutdown.
 
130
 
 
131
All log output will be in
 
132
.I $XDG_CACHE_HOME/upstart
 
133
which defaults to
 
134
.I $HOME/.cache/upstart
 
135
.
119
136
 
120
137
.\"
121
138
.SS Configuration File Format
366
383
is via \fBstart\fP (8).
367
384
 
368
385
.SS Job environment
369
 
Each job is run with the environment from the events or commands that
370
 
started it.  In addition, you may define defaults in the job which may
371
 
be overridden later and specify which environment variables are exported
372
 
into the events generated for the job.
373
 
 
 
386
Each job is run with an environment constructed from the
 
387
following categories:
 
388
.\"
 
389
.IP \(bu 4
 
390
A minimal set of standard system variables added by Upstart.
 
391
.sp 1
 
392
All jobs contain the
 
393
.B TERM
 
394
and
 
395
.B PATH
 
396
variables.
 
397
.\"
 
398
.IP \(bu 4
 
399
Variables set using the 
 
400
.BR initctl (8)
 
401
job environment commands (such as \fIset-env\fP).
 
402
.sp 1
 
403
These commands also allow unsetting of variables.
 
404
.\"
 
405
.IP \(bu 4
 
406
A set of special variables added by Upstart that relate to the job itself.
 
407
.sp 1
 
408
All jobs also contain the
 
409
.B UPSTART_JOB
 
410
and
 
411
.B UPSTART_INSTANCE
 
412
environment variables, containing the name of the job and instance.  These
 
413
are mostly used by the
 
414
.BR initctl (8)
 
415
utility to default to acting on the job the commands are called from.
 
416
.\"
 
417
.IP \(bu 4
 
418
Those variables introduced by the events or command that started the
 
419
job.
 
420
.sp 1
374
421
The special
375
422
.B UPSTART_EVENTS
376
423
environment variable contains the list of events that started the job,
377
424
it will not be present if the job was started manually.
378
425
 
379
 
In addition, the
 
426
The
380
427
.B pre\-stop
381
428
and
382
429
.B post\-stop
385
432
.B UPSTART_STOP_EVENTS
386
433
environment variable contains the list of events that stopped the job,
387
434
it will not be present if the job was stopped manually.
388
 
 
389
 
All jobs also contain the
390
 
.B UPSTART_JOB
 
435
.\"
 
436
.IP \(bu 4
 
437
Variables set within the job itself using the
 
438
.B env
391
439
and
392
 
.B UPSTART_INSTANCE
393
 
environment variables, containing the name of the job and instance.  These
394
 
are mostly used by the
395
 
.BR initctl (8)
396
 
utility to default to acting on the job the commands are called from.
397
 
 
 
440
.B export
 
441
stanzas. These provide default values - if the command or event which causes the
 
442
job to start specifies alternative values, those are given priority over
 
443
the defaults.
 
444
.RS
 
445
.\"
398
446
.TP
399
447
.B env \fIKEY\fR[=\fIVALUE\fR]
400
448
Defines a default environment variable, the value of which may be overridden
417
465
and to all resultant events
418
466
.ft
419
467
(not just those relating to the current job).
 
468
.RE
 
469
 
 
470
The first two categories above comprise the
 
471
.I job environment table
 
472
which is applied to all jobs. Note that changing the job environment
 
473
table will only affect newly-started jobs.
420
474
.\"
421
475
.SS Services, tasks and respawning
422
476
Jobs are
611
665
.B log
612
666
.RS
613
667
.B
614
 
Only applies to system jobs:
615
 
if specified by user jobs, the job will be considered to have specified
616
 
the value
617
 
.BR none "."
618
 
 
619
 
For system jobs, if \fBlog\fR is specified, standard input is connected
 
668
If \fBlog\fR is specified, standard input is connected
620
669
to
621
670
.IR /dev/null ","
622
671
and standard output and standard error are connected to a pseudo-tty
623
672
which logs all job output.
624
673
 
625
674
Output is logged to file
626
 
.IR /var/log/upstart/<job-log-file> "."
 
675
.IR /var/log/upstart/<job-log-file>
 
676
or
 
677
.IR $XDG_CACHE_HOME/upstart/<job-log-file>
 
678
for system and user session jobs respectively.
 
679
 
627
680
If a job has specified \fBinstance\fR,
628
681
.I <job-log-file>
629
682
will equate to
821
874
block is used for all job processes. If both stanzas are unspecified,
822
875
all job processes will run with its group ID set to 0 in the case of
823
876
system jobs, and as the primary group of the user in the case of User
824
 
Jobs.
 
877
Session jobs.
825
878
.\"
826
879
.SS Override File Handling
827
880
Override files allow a jobs environment to be changed without modifying
965
1018
.
966
1019
.TP
967
1020
.I $HOME/.init/*.conf
968
 
User job configuration files.
969
 
Note that you may make the directory
970
 
.I $HOME/.init/
971
 
a symbolic link to
972
 
.BR $HOME/.config/upstart/ "."
 
1021
User job configuration files
 
1022
.BR (deprecated) .
973
1023
.
974
1024
.TP
975
1025
.I $HOME/.init/*.override
976
1026
User job override files.
 
1027
.BR (deprecated) .
 
1028
.
 
1029
.TP
 
1030
.I $XDG_CONFIG_HOME/upstart/*.conf
 
1031
User session job configuration files. See
 
1032
.B User Session Mode
 
1033
for other locations.
 
1034
.
 
1035
.TP
 
1036
.I $XDG_CONFIG_HOME/upstart/*.override
 
1037
User session job override files. See
 
1038
.B User Session Mode
 
1039
for other locations.
977
1040
.
978
1041
.TP
979
1042
.I /var/log/upstart/*.log
980
1043
Default location of system job output logs.
 
1044
.
 
1045
.TP
 
1046
.I $XDG_CACHE_HOME/upstart/*.log
 
1047
Default location of user session job output logs.
 
1048
.TP
 
1049
.I $XDG_RUNTIME_DIR/upstart/sessions/*.session
 
1050
Location of session files created when running in User Session mode.
981
1051
.RE
982
1052
.\"
983
1053
.SH AUTHOR
991
1061
.RB < https://launchpad.net/upstart/+bugs >
992
1062
.\"
993
1063
.SH COPYRIGHT
994
 
Copyright \(co 2009-2011 Canonical Ltd.
 
1064
Copyright \(co 2009-2013 Canonical Ltd.
995
1065
.br
996
1066
This is free software; see the source for copying conditions.  There is NO
997
1067
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1000
1070
.SH SEE ALSO
1001
1071
.BR init (8)
1002
1072
.BR initctl (8)
 
1073
.BR prctl (2)
 
1074
.BR pty (7)
1003
1075
.BR sh (1)
1004
1076
.BR upstart-events (7)
1005
1077
.BR pty (7)