Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

inoticoming(1) [debian man page]

INOTICOMING(1)							    INOTICOMING 						    INOTICOMING(1)

NAME
inoticoming - trigger actions when files hit an incoming directory SYNOPSIS
inoticoming [ global-options ] directory actions* DESCRIPTION
Inoticoming is a daemon to watch a directory with Linux's inotify framework and trigger actions once files with specific names are placed in there. For example it can be used to wait for .changes files uploaded into a directory and call reprepro to put them into your repository. GLOBAL OPTIONS
--foreground Do not fork, but stay in the foreground and log to stderr. --logfile filename After forking in the background, log to the specified filename instead of syslog. --pid-file filename Write the pid of the running instance into filename. --initialsearch First search the directory for files already existing and process them with the given rules as if they just appeared. If files show up in this inital phase, they may be processed twice, but should never be missed. (Unless they are too many and the inotify queue overflows). ACTIONS
Each action description is an optional list of options for this action (which files to call it for, what directory to change into before executing it, ...), followed by the command and its arguments ended with a single ; as argument. Like: inoticoming --foreground / --regexp ^v echo There appeared {} in the root directory. ; (Note that the before the ; is needed if and only if you calling it from a shell or anything else interpreting the ; on its own). ACTION OPTIONS --prefix string Only trigger this action, if the filename starts with the specified string. --suffix string Only trigger this action, if the filename ends with the specified string. --regexp regular expression Only trigger this action, if the filename matches the specified regular expression. --chdir directory Change into directory before executing the specified commands. (Note that since it is a well-behaved daemon, its working directory is / which will be inherited by all actions). --stdout-to-log Redirect the command's output (stdout) to the logfile. --stderr-to-log Redirect the command's error output (stderr) to the logfile. EXAMPLES
inoticoming --logfile logs/ilog --pid-file pid $INCOMINGDIR --suffix .changes --stderr-to-log reprepro -s -b $REPREPROBASEDIR --waitforlock 1000 processincoming rulename {} ; This will call reprepro for every new .changes file. Note that giving {} as argument to processincoming (which inoticoming will replace with the filename) so that only that .changes file is processed and reprepro will not complain about a possible other yet incomplete .changes file is only available starting with reprepro version 2.2.2. PROBLEMS
There is no handling of queue overflows yet. REPORTING BUGS
Report bugs or wishlist requests to the Debian BTS (e.g. by using reportbug inoticoming under Debian) or directly to <brlink@debian.org>. COPYRIGHT
Copyright (C) 2007 Bernhard R. Link This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. inoticoming 2007-08-18 INOTICOMING(1)

Check Out this Related Man Page

acpid(8)						      System Manager's Manual							  acpid(8)

NAME
acpid - Advanced Configuration and Power Interface event daemon SYNOPSIS
acpid [options] DESCRIPTION
acpid is designed to notify user-space programs of ACPI events. acpid should be started during the system boot, and will run as a back- ground process, by default. It will open an events file (/proc/acpi/event by default) and attempt to read whole lines. When a line is received (an event), acpid will examine a list of rules, and execute the rules that match the event. acpid will ignore all incoming ACPI events if a lock file exists (/var/lock/acpid by default). Rules are defined by simple configuration files. acpid will look in a configuration directory (/etc/acpi/events by default), and parse all regular files that do not begin with a period ('.') or end with a tilde (~). Each file must define two things: an event and an action. Any blank lines, or lines where the first character is a hash ('#') are ignored. Extraneous lines are flagged as warnings, but are not fatal. Each line has three tokens: the key, a literal equal sign, and the value. The key can be up to 63 characters, and is case-insensi- tive (but whitespace matters). The value can be up to 511 characters, and is case and whitespace sensitive. The event value is a regular expression (see regcomp(3)), against which events are matched. The action value is a commandline, which will be invoked via /bin/sh whenever an event matching the rule in question occurs. The command- line may include shell-special characters, and they will be preserved. The only special characters in an action value are "%" escaped. The string "%e" will be replaced by the literal text of the event for which the action was invoked. This string may contain spaces, so the commandline must take care to quote the "%e" if it wants a single token. The string "%%" will be replaced by a literal "%". All other "%" escapes are reserved, and will cause a rule to not load. This feature allows multiple rules to be defined for the same event (though no ordering is guaranteed), as well as one rule to be defined for multiple events. To force acpid to reload the rule configuration, send it a SIGHUP. In addition to rule files, acpid also accepts connections on a UNIX domain socket (/var/run/acpid.socket by default). Any application may connect to this socket. Once connected, acpid will send the text of all ACPI events to the client. The client has the responsibility of filtering for messages about which it cares. acpid will not close the client socket except in the case of a SIGHUP or acpid exiting. acpid will log all of its activities, as well as the stdout and stderr of any actions, to syslog. All the default files and directories can be changed with commandline options. OPTIONS
-c, --confdir directory This option changes the directory in which acpid looks for rule configuration files. Default is /etc/acpi/events. -C, --clientmax number This option changes the maximum number of non-root socket connections which can be made to the acpid socket. Default is 256. -d, --debug This option increases the acpid debug level by one. If the debug level is non-zero, acpid will run in the foreground, and will log to stderr, in addition to the regular syslog. -e, --eventfile filename This option changes the event file from which acpid reads events. Default is /proc/acpi/event. -f, --foreground This option keeps acpid in the foreground by not forking at startup. -l, --logevents This option tells acpid to log information about all events and actions. -L, --lockfile filename This option changes the lock file used to stop event processing. Default is /var/lock/acpid. -g, --socketgroup groupname This option changes the group ownership of the UNIX domain socket to which acpid publishes events. -m, --socketmode mode This option changes the permissions of the UNIX domain socket to which acpid publishes events. Default is 0666. -s, --socketfile filename This option changes the name of the UNIX domain socket which acpid opens. Default is /var/run/acpid.socket. -S, --nosocket filename This option tells acpid not to open a UNIX domain socket. This overrides the -s option, and negates all other socket options. -p, --pidfile filename This option tells acpid to use the specified file as its pidfile. If the file exists, it will be removed and over-written. Default is /var/run/acpid.pid. -v, --version Print version information and exit. -h, --help Show help and exit. EXAMPLE
This example - placed in /etc/acpi/events/power - will shut down your system if you press the power button. event=button/power.* action=/usr/local/sbin/power.sh "%e" The script power.sh gets called and will see the complete event string as parameter $1. DEPENDENCIES
acpid should work on any linux kernel released since 2003. FILES
/proc/acpi/event /etc/acpi/ /var/run/acpid.socket /var/run/acpid.pid /var/lock/acpid BUGS
There are no known bugs. To file bug reports, see AUTHORS below. SEE ALSO
regcomp(3), sh(1), socket(2), connect(2) AUTHORS
Tim Hockin <thockin@hockin.org> acpid(8)
Man Page