Subversion Repositories public

Compare Revisions

Ignore whitespace Rev 56 → Rev 57

/incron/trunk/incrontab.5
0,0 → 1,39
.TH "incrontab" "5" "0.3.1" "Lukas Jelinek" "incron documentation"
.SH "NAME"
incrontab \- tables for driving inotify cron (incron)
.SH "DESCRIPTION"
An incrontab file contains instructions to the \fIincrond\fR(8) daemon of the general form: "run this command on these file events". Each user has their own incrontab, and commands in any given incrontab will be executed as the user who owns the incrontab. System users (such as apache, postfix, nobody etc.) may have their own incrontab.
 
incrontab files are read when the \fIincrond\fR(8) daemon starts and after any change (incrontab file are being hooked when incrond is running).
 
Blank lines are ignored. The general line format is the following:
 
<path> <mask> <command>
 
Where \fIpath\fR is an absolute filesystem path, \fImask\fR is an event mask (in symbolic or numeric form) and \fIcommand\fR is an executable file (or a script) with its arguments. The executable file may be noted as an absolute path or only as the name itself (PATH locations are examined).
 
Please remember that the same path may occur only once (otherwise the behavior is undefined).
.SH "EXAMPLE"
These are some example rules which can be used in an incrontab file:
 
/tmp IN_ALL_EVENTS abcd $@/$# $%
 
/usr/bin IN_ACCESS,IN_NO_LOOP abcd $#
 
/home IN_CREATE /usr/local/bin/abcd $#
 
/var/log 12 abcd $@/$#
 
The first line monitors all events on the /tmp directory. When an event occurs it runs a application called 'abcd' with the full path of the file as the first arguments and the event flags as the second one.
 
The second line monitors accesses (readings) on the /usr/bin directory. The application 'abcd' is run as a handler and the appropriate event watch is disabled until the program finishes. The file name (without the directory path) is passed in as an argument.
 
The third example is used for monitoring the /home directory for newly create files or directories (it practically means an event is sent when a new user is added). This event is processed by a program specified by an absolute path.
 
And the final line shows how to use numeric event mask instead of textual one. The value 12 is exactly the same as IN_ATTRIB,IN_CLOSE_WRITE.
.SH "SEE ALSO"
incrond(8), incrontab(1)
.SH "AUTHOR"
Lukas Jelinek <lukas@aiken.cz>
.SH "COPYING"
This program is free software. It can be used, redistributed and/or modified under the terms of the GNU General Public License, version 2.
/incron/trunk/CHANGELOG
1,3 → 1,8
0.3.1 2006-11-24
* user manual added
* incron tables now owned by root (also fixes #0000103)
 
 
0.3.0 2006-11-12
* based on inotify-cxx 0.5.2 (fixes a problem with ignoring IN_OPEN)
* two new special symbols ($% for flags as names, $& for numeric flags)
/incron/trunk/README
38,9 → 38,7
check the PREFIX and other common variables. If done you can
now build the files ('make').
 
The binaries must be of course installed as root. Note that the
installer creates a special user called 'incron' which manages
the incron tables.
The binaries must be of course installed as root.
 
 
4. How to use
100,6 → 98,6
modify it under the terms of the GNU General Public License,
version 2 (see LICENSE-GPL).
 
Some parts may be also licensed covere by other licenses.
Some parts may be also covered by other licenses.
Please look into the source files for detailed information.
 
/incron/trunk/incrontab.cpp
29,6 → 29,18
/// Denied users
#define INCRON_DENY_PATH "/etc/incron.deny"
 
/*
* ALLOW/DENY SEMANTICS
*
* If /etc/incron.allow exists ONLY users contained here
* are allowed to use incron.
*
* Otherwise, if /etc/incron.deny exists only user NOT
* contained here are allowed to use incron.
*
* Otherwise all users may use incron.
*
*/
 
 
 
/incron/trunk/incrond.8
0,0 → 1,24
.TH "incrond" "8" "0.3.1" "Lukas Jelinek" "incron documentation"
.SH "NAME"
incrond \- inotify cron (incron) daemon
 
.SH "SYNOPSIS"
\fBincrond\fR
.SH "DESCRIPTION"
The inotify cron daemon (\fIincrond\fR) is a daemon which monitors filesystem events and executes commands defined in user tables. It's use is generally similar to \fIcron\fR(8).
 
\fIincrond\fR can be started from /etc/rc, /etc/rc.local and so on. It daemonizes itself (returns immediately) and doesn't need to be started with & and through \fInohup\fR(1). Running on foreground is currently not possible but it will be implemented in the future.
 
\fIincrond\fR searches /var/spool/incron for \fIincrontab\fR(5) files named after user accounts. If a table (incrontab) is changed \fIincrond\fR reacts immediately and reloads the table. Currently running subprocesses (commands) are not affected.
 
There are two files determining whether an user is allowed to use incron. These files have very simple syntax \- one user name per line. If /etc/incron.allow exists the user must be noted there to be allowed to use incron. Otherwise if /etc/incron.deny exists the user must not be noted there to use incron. If none of these files exists there is no other restriction whether anybody may use incron.
 
The daemon itself is currently not protected against looping. If a command executed due to an event causes the same event it leads to an infinite loop unless a flag mask containing IN_NO_LOOP is specified. Please beware of this and do not allow permission for use incron to unreliable users.
.SH "SEE ALSO"
incrontab(1), incrontab(5)
.SH "BUGS"
incrond is currently not resistent against looping.
.SH "AUTHOR"
Lukas Jelinek <lukas@aiken.cz>
.SH "COPYING"
This program is free software. It can be used, redistributed and/or modified under the terms of the GNU General Public License, version 2.
/incron/trunk/TODO
1,4 → 1,3
Currently pending tasks:
 
#0000101 - Temporary files not removed
#0000103 - User overriding doesn't work
/incron/trunk/Makefile
1,8 → 1,9
 
PREFIX = /usr/local
DATADIR = /var/spool/incron
MANPATH = /usr/share/man
 
USER = incron
USER = root
 
CXX = g++
INSTALL = install
10,9 → 11,10
OPTIMIZE = -O2
DEBUG = -g0
WARNINGS = -Wall
CXXAUX = -pipe
 
CPPFLAGS =
CXXFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS)
CXXFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS) $(CXXAUX)
LDFLAGS = $(WARNINGS)
 
PROGRAMS = incrond incrontab
38,22 → 40,33
 
distclean: clean
 
install: all
install: all install-man
[ -d $(PREFIX) ]
useradd -M -s /sbin/nologin $(USER) || useradd -s /sbin/nologin $(USER)
$(INSTALL) -m 04755 -o $(USER) incrontab $(PREFIX)/bin/
$(INSTALL) -m 0755 incrond $(PREFIX)/sbin/
$(INSTALL) -m 0755 -o $(USER) -d $(DATADIR)
 
uninstall:
install-man: incrontab.1 incrontab.5 incrond.8
$(INSTALL) -m 0755 -d $(MANPATH)/man1
$(INSTALL) -m 0755 -d $(MANPATH)/man5
$(INSTALL) -m 0755 -d $(MANPATH)/man8
$(INSTALL) -m 0644 incrontab.1 $(MANPATH)/man1
$(INSTALL) -m 0644 incrontab.5 $(MANPATH)/man5
$(INSTALL) -m 0644 incrond.8 $(MANPATH)/man8
 
uninstall: uninstall-man
[ -d $(PREFIX) ]
rm -f $(PREFIX)/bin/incrontab
rm -f $(PREFIX)/sbin/incrond
userdel $(USER)
 
uninstall-man:
rm -f $(MANPATH)/man1/incrontab.1
rm -f $(MANPATH)/man5/incrontab.5
rm -f $(MANPATH)/man8/incrontab.8
 
.PHONY: all clean distclean install uninstall
 
.PHONY: all clean distclean install install-man uninstall uninstall-man
 
.POSIX:
 
icd-main.o: icd-main.cpp inotify-cxx.h incrontab.h usertable.h incron.h
/incron/trunk/incron.h
27,7 → 27,7
#define INCRON_TAB_NAME "incrontab"
 
/// Application version (release)
#define INCRON_VERSION "0.3.0"
#define INCRON_VERSION "0.3.1"
 
/// Address for sending bugs
#define INCRON_BUG_ADDRESS "<bugs@aiken.cz>"
/incron/trunk/incrontab.1
0,0 → 1,33
.TH "incrontab" "1" "0.3.1" "Lukas Jelinek" "incron documentation"
.SH "NAME"
incrontab \- table manipulator for inotify cron (incron)
.SH "SYNOPSIS"
\fBincrontab\fR [\fB\-u\fR \fIuser\fR] \fIfile\fR
 
\fBincrontab\fR [\fB\-u\fR \fIuser\fR] [\fB\-l\fR | \fB\-r\fR | \fB\-e\fR]
.SH "DESCRIPTION"
incrontab is a table manipulator for the inotify cron (incron) system. It creates, removes, modifies and lists user tables (\fIincrontab\fR(5)).
 
Each user (including system users even they haven't home directories) has an incron table which can't be manipulated directly (only root can effectively change these tables and is NOT recommended to do so).
 
All informational messages of this program are printed to the standard error output (stderr).
 
If \fI/etc/incron.allow\fR exists only users listed here may use incron. Otherwise if \fI/etc/incron.deny\fR exists only users NOT listed here may use incron. If none of these files exists everyone is allowed to use incron. (\fBImportant note:\fR This behavior is insecure and will be probably changed to be compatible with the style used by ISC Cron.)
 
The first form of this command imports a file, validates it and stores to the table. "\-" can be used for loading from the standard input.
 
 
 
\fB\-u\fR (or \fB\-\-user\fR) option overrides the current (real) user to the given one. This option is intended for manipulation with system users' tables (such as apache, postfix, daemon etc.). It can be used only if the current user has root's effective rights.
 
\fB\-l\fR (or \fB\-\-list\fR) option causes the current table is printed to the standard output.
 
\fB\-r\fR (or \fB\-\-remove\fR) option causes the current table (if any) is permanently remove without any warning or confirmation. Use with caution!
 
\fB\-e\fR (or \fB\-\-edit\fR) option causes executing the editor specified by the EDITOR environment variable (if not defined the hard\-coded editor is executed instead). You can edit your incron table now. If the table is changed it stores the modified version. It's not recommended to use graphical editors (such as gVim, KEdit etc.) due to possible problems with connecting to the X server.
.SH "SEE ALSO"
incrond(8), incrontab(5)
.SH "AUTHOR"
Lukas Jelinek <lukas@aiken.cz>
.SH "COPYING"
This program is free software. It can be used, redistributed and/or modified under the terms of the GNU General Public License, version 2.