Merge authors:
James Hunt (jamesodhunt)
Related merge proposals:
https://code.launchpad.net/~jamesodhunt/upstart/file-bridge-change-fpath-to-file-et-al/+merge/153603
proposed by: James Hunt (jamesodhunt)
------------------------------------------------------------
revno: 1454 [merge]
committer: Steve Langasek <[email protected]>
branch nick: upstream
timestamp: Tue 2013-03-19 01:08:54 -0700
message:
Merge lp:~jamesodhunt/upstart/file-bridge-change-fpath-to-file-et-al
modified:
extra/man/file-event.7
extra/man/upstart-file-bridge.8
extra/upstart-file-bridge.c
--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk
Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'extra/man/file-event.7'
--- extra/man/file-event.7 2013-03-15 18:16:08 +0000
+++ extra/man/file-event.7 2013-03-19 08:08:54 +0000
@@ -5,9 +5,9 @@
.\"
.SH SYNOPSIS
.B file
-.BI FPATH\fR= PATH
-.BI FEVENT\fR= TYPE
-.IB \fR[ FMATCH\fR= PATH \fR]
+.BI FILE\fR= PATH
+.BI EVENT\fR= TYPE
+.IB \fR[ MATCH\fR= PATH \fR]
.\"
.SH DESCRIPTION
@@ -23,10 +23,10 @@
stanza is modified.
The
-.BR FPATH " and " FEVENT
+.BR FILE " and " EVENT
environment variables will be set to the same values as specified by the
job. Note that if the job did not specify
-.B FEVENT
+.B EVENT
this will still be set to one of
.BR create ", "
.BR modify " or "
@@ -34,12 +34,12 @@
depending on what type of file event caused the event to be emitted.
If the job specified a glob pattern in the file part of the
-.B FPATH
+.B FILE
environment variable, the event will contain the
-.B FMATCH
+.B MATCH
environment variable which will be set to the full path of the file that
matched the pattern in
-.BR FPATH "."
+.BR FILE "."
.\"
.SH NOTES
@@ -48,31 +48,31 @@
quoted.
.\"
.IP \(bu
-.B FPATH
+.B FILE
values specified by jobs are not canonicalised; this cannot be done reliably
as they may not exist so cannot be fully resolved.
.\"
.IP \(bu
If you wish to match on
-.BR FMATCH ", "
+.BR MATCH ", "
ensure that
-.B FPATH
+.B FILE
does not contain multiple consecutive runs of slashes since otherwise
your job will find it difficult to perform such a match.
.\"
.SH EXAMPLES
.\"
-.IP "start on file FPATH=/run/app.pid FEVENT=created" 0.4i
+.IP "start on file FILE=/run/app.pid EVENT=created" 0.4i
Event emitted when file is created.
-.IP "start on file FPATH=/run/app.pid"
+.IP "start on file FILE=/run/app.pid"
Event emitted when file is created, modified or deleted.
-.IP "start on file FPATH=/var/log/"
+.IP "start on file FILE=/var/log/"
Event emitted when files within a directory are created, modified or
deleted.
-.IP "start on file FPATH=/var/crash/*.crash FEVENT=created"
+.IP "start on file FILE=/var/crash/*.crash EVENT=created"
Event emitted when files that match a glob pattern are created in the
indicated directory.
-.IP "start on file FPATH=""/this/path/contains whitespace.txt"""
+.IP "start on file FILE=""/this/path/contains whitespace.txt"""
Specify a file that contains a space character.
.\"
.SH AUTHOR
=== modified file 'extra/man/upstart-file-bridge.8'
--- extra/man/upstart-file-bridge.8 2013-03-11 20:02:18 +0000
+++ extra/man/upstart-file-bridge.8 2013-03-15 17:12:38 +0000
@@ -61,7 +61,7 @@
.\"
.SH JOB ENVIRONMENT VARIABLES
.TP
-.B FPATH
+.B FILE
Path to file to watch. When run without
.BR \-\-user ","
this must be an absolute path. If
@@ -93,35 +93,35 @@
.RE
.\"
.TP
-.B FEVENT
+.B EVENT
Event relating to
-.B FPATH
+.B FILE
that job is interested in. If this variable is specified the value must
be set to
.BR create ", "
.BR modify " or "
.B delete
depending on what type of file event the job is interested in. If
-.B FPATH
+.B FILE
is not specified, the bridge will watch for all types and set this
variable to the appropriate value when emitting the event.
.\"
.SH WATCH TYPE BEHAVIOUR
The bridge emits events depending not only on the value of
-.BR FEVENT ", "
+.BR EVENT ", "
but also on the entity specified by
-.BR FPATH ":"
+.BR FILE ":"
.\"
.SS File
An event will be emitted when the named file is created, modified or
-deleted depending on the value of \fBFEVENT\fR. If
-.B FEVENT
+deleted depending on the value of \fBEVENT\fR. If
+.B EVENT
is not specified, react to creation, modification and deletion.
If the file already exists when the job is registered, and
-.B FEVENT
+.B EVENT
either specifies
.I create
or the variable is not specified, the event will be emitted.
@@ -131,12 +131,12 @@
An event will be emitted when the named directory is created, modified
(files within it are created, modified or deleted) or deleted depending
on the value of
-\fBFEVENT\fR. If
-.B FEVENT
+\fBEVENT\fR. If
+.B EVENT
is not specified, react to creation, modification and deletion.
If the directory already exists when the job is registered, and
-.B FEVENT
+.B EVENT
either specifies
.I create
or the variable is not specified, the event will be emitted.
@@ -146,12 +146,12 @@
One event will be emitted per match when the glob wildcard matches any
files in the directory part is created, modified or deleted, depending
on the value of
-\fBFEVENT\fR. If
-.B FEVENT
+\fBEVENT\fR. If
+.B EVENT
is not specified, react to creation, modification and deletion.
If any matches already exist when the job is registered, and
-.B FEVENT
+.B EVENT
either specifies
.I create
or the variable is not specified, events will be emitted.
=== modified file 'extra/upstart-file-bridge.c'
--- extra/upstart-file-bridge.c 2013-03-15 12:44:29 +0000
+++ extra/upstart-file-bridge.c 2013-03-15 17:12:38 +0000
@@ -553,7 +553,7 @@
}
if (user) {
- /* Ensure we are sitting in $HOME so relative FPATH
+ /* Ensure we are sitting in $HOME so relative FILE
* values work as expected.
*/
if (chdir (home_dir) < 0) {
@@ -744,7 +744,7 @@
name_len = val - *env;
val++;
- if (! strncmp (*env, "FPATH", name_len)) {
+ if (! strncmp (*env, "FILE", name_len)) {
char dirpart[PATH_MAX];
char basepart[PATH_MAX];
char *dir;
@@ -789,7 +789,7 @@
strcpy (path, dir);
glob_expr = NIH_MUST (nih_strdup (NULL, base));
}
- } else if (! strncmp (*env, "FEVENT", name_len)) {
+ } else if (! strncmp (*env, "EVENT", name_len)) {
if (! strcmp (val, "create")) {
events = IN_CREATE;
} else if (! strcmp (val, "modify")) {
@@ -1359,17 +1359,17 @@
env = NIH_MUST (nih_str_array_new (NULL));
- var = NIH_MUST (nih_sprintf (NULL, "FPATH=%s", path));
+ var = NIH_MUST (nih_sprintf (NULL, "FILE=%s", path));
NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var));
- var = NIH_MUST (nih_sprintf (NULL, "FEVENT=%s",
+ var = NIH_MUST (nih_sprintf (NULL, "EVENT=%s",
event_type == IN_CREATE ? "create" :
event_type == IN_MODIFY ? "modify" :
"delete"));
NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var));
if (match) {
- var = NIH_MUST (nih_sprintf (NULL, "FMATCH=%s", match));
+ var = NIH_MUST (nih_sprintf (NULL, "MATCH=%s", match));
NIH_MUST (nih_str_array_addp (&env, NULL, &env_len, var));
}
@@ -1444,7 +1444,7 @@
* path handed to inotify also gets given to the
* create/modify/delete handlers which can then lead to
* multiple consecutive slashes which could result in
- * jobs failing to start as they would not expect FMATCH
+ * jobs failing to start as they would not expect MATCH
* to contain such values.
*
* Note that we do not (cannot) do this if @path is
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel