.TH upstart\-file\-bridge 8 2013-03-11 upstart .\" .SH NAME upstart\-file\-bridge \- Bridge between Upstart and inotify .\" .SH SYNOPSIS .B upstart\-file\-bridge .RI [ OPTIONS ]... .\" .SH DESCRIPTION .B upstart\-file\-bridge receives information about kernel file events that .BR inotify (7) has received and creates .BR init (8) events for them. Supported events exposed to Upstart allow jobs to detect creation, modification and deletion. See .BR file\-event (7) for further details. The bridge works by querying the .BR init (8) daemon at bridge startup time to determine a list of all jobs whose .B start on or .B stop on conditions reference the .B file event. Further, the bridge arranges to be notified automatically when new jobs are created such that any subsequent jobs which reference the .B file event are also handled (as are job deletions). See \fBinotify\fP(7) and for further details. .\" .SH OPTIONS .\" .TP .B \-\-daemon Detach and run in the background. .\" .TP .B \-\-debug Enable debugging output. .\" .TP .B \-\-help Show brief usage summary. .\" .TP .B \-\-user User-session mode: connect to Upstart via the user session rather than over the D\-Bus system bus. .\" .TP .B \-\-verbose Enable verbose output. .\" .SH JOB ENVIRONMENT VARIABLES .TP .B FILE Path to file to watch. When run without .BR \-\-user "," this must be an absolute path. If .BR \-\-user is specified, certain relative path types are supported: .RS .IP \[bu] 2 If the path begins with \(aq~/\(aq, the value will be expanded as would be performed by a shell for matching purposes (although when the event is emitted, the original value will be used). .\" .IP \[bu] If the path begins with \(aq./\(aq, \(aq.\(aq will be assumed to be the users home directory. .\" .IP \[bu] In all other scenarios, if the path does not begin with \(aq/\(aq, it will be assumed to represent a file below the users home directory. .P If the path ends with a slash, it is considered to be a directory which changes the match behaviour (see below). .P If the path is not a directory, the file (but not the directory) portion of the path may contain wildcard matches. See .BR fnmatch (3) and .BR glob (7) for further details. .RE .\" .TP .B EVENT Event relating to .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 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 EVENT ", " but also on the entity specified by .BR FILE ":" .\" .SS File An event will be emitted when the named file is created, modified or 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 EVENT either specifies .I create or the variable is not specified, the event will be emitted. .\" .SS Directory 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 \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 EVENT either specifies .I create or the variable is not specified, the event will be emitted. .\" .SS Glob 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 \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 EVENT either specifies .I create or the variable is not specified, events will be emitted. .\" .SH NOTES .IP \(bu 4 A single instance of the bridge may be run at the system level, but multiple further instances may be run per user session instance by using the .BR \-\-user "." .IP \(bu All job conditions specifying the .B file event are multi-shot: if the same file event occurs multiple times, the bridge will emit an Upstart event each time. .\" .SH LIMITATIONS .IP \(bu 4 Since the bridge currently uses .BR inotify (7) "" "," it is subject to the same limitations; namely that recursive watches cannot be created reliably in all circumstances. As such, pathological scenarios such as deep directory trees being created and then quickly removed .B cannot be handled reliably. The following provides advice to minimise unexpected behaviour: .RS .IP \(bu 4 Attempt to only watch for files to be created, modified or deleted in directories that are guaranteed to already exist at the time the job is registered by the bridge. .\" .IP \(bu If the system cannot guarantee that the directory will exist at job registration time, arrange for the directory to be created by an Upstart job before the bridge itself starts. .\" .IP \(bu In user session mode, if a job specifies a file to watch for and that file is created but inaccessible to the user running the bridge, no event will be emitted. .RE .IP \(bu Tilde expansion is only supported for the current user; that is \(aq~otheruser\(aq will not work. .\" .SH AUTHOR Written by James Hunt .RB < james.hunt@canonical.com > .\" .SH BUGS Report bugs at .RB < https://launchpad.net/ubuntu/+source/upstart/+bugs > .\" .SH COPYRIGHT Copyright \(co 2013 Canonical Ltd. .PP This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO .BR init (5) .BR init (8) .BR inotify (7) .BR file-event (7)