summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-20 13:49:14 +0200
committerChristian Pointner <equinox@spreadspace.org>2015-09-20 13:49:14 +0200
commit18372ecc6e3c5bdf7878cdb2dfa065f6253da2b8 (patch)
treee62c63399f2e3bc1305ce23117b2c172940b0af8
parentfixed race condition between killing processes (diff)
added Readme and updated manpage
-rw-r--r--README58
-rw-r--r--doc/dropnroll.848
-rw-r--r--doc/dropnroll.8.txt21
-rw-r--r--src/options.c2
4 files changed, 122 insertions, 7 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..b387555
--- /dev/null
+++ b/README
@@ -0,0 +1,58 @@
+Introduction
+============
+
+dropnroll is a small daemon which can be used to watch one or more
+directories for new files. When a new file is detected an external program will
+get started.
+Additional directories can be added to the daemon's watch list using a simple
+unix socket based command interface.
+
+Dependencies
+============
+
+Linux
+-----
+
+core:
+ build-essential
+
+if you want to rebuild the manpage:
+ asciidoc
+
+
+Installation
+============
+
+Getting the source via GIT:
+---------------------------
+
+git clone git://git.spreadspace.org/dropnroll.git
+cd dropnroll
+
+
+Building from source
+--------------------
+
+# cd src
+# ./configure
+# make
+
+
+Installing
+----------
+
+# sudo make install
+
+This will install dropnroll under the --prefix defined with configure.
+
+
+Uninstalling
+------------
+
+# sudo make remove
+
+This removes everything except for the config files
+
+# sudo make purge
+
+This also removes the config files
diff --git a/doc/dropnroll.8 b/doc/dropnroll.8
index 76f8f81..2120d14 100644
--- a/doc/dropnroll.8
+++ b/doc/dropnroll.8
@@ -2,12 +2,12 @@
.\" Title: dropnroll
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 09/16/2015
+.\" Date: 09/20/2015
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DROPNROLL" "8" "09/16/2015" "\ \&" "\ \&"
+.TH "DROPNROLL" "8" "09/20/2015" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -40,9 +40,11 @@ dropnroll \- drop\*(Aqn\*(Aqroll daemon
[ \fB\-C|\-\-chroot\fR <path> ]
[ \fB\-P|\-\-write\-pid\fR <filename> ]
[ \fB\-L|\-\-log\fR <target>:<level>[,<param1>[,<param2>[\&.\&.]]] ]
+ [ \fB\-U|\-\-debug\fR ]
[ \fB\-s|\-\-command\-sock\fR <unix sock> ]
[ \fB\-x|\-\-script\fR <script> ]
[ \fB\-m|\-\-max\-children\fR <#of children> ]
+ [ \fB\-p|\-\-children\-policy\fR (defer|drop|kill\-oldest) ]
[ \fB\-d|\-\-dir\fR <path> ]
.fi
.SH "DESCRIPTION"
@@ -114,10 +116,23 @@ log to standard error, parameters <level>
.RE
.RE
.PP
+\fB\-U, \-\-debug\fR
+.RS 4
+This option instructs
+\fBdropnroll\fR
+to run in debug mode\&. It implicits
+\fB\-D\fR
+(don\(cqt daemonize) and adds a log target with the configuration
+\fIstdout:5\fR
+(logging with maximum level)\&. In future releases there might be additional output when this option is supplied\&.
+.RE
+.PP
\fB\-s|\-\-command\-sock \fR\fB\fI<unix sock>\fR\fR
.RS 4
\fBdropnroll\fR
-will listen on this unix socket for incoming commands\&. See next chapter for details\&. The default is /var/run/dropnroll/cmd\&.sock
+will listen on this unix socket for incoming commands\&. See next chapter for details\&. If there are directories specified using the
+\fB\-\-dir\fR
+option and this is kept empty the command socket is deactivated\&. If no directories are added it defaults to /var/run/dropnroll/cmd\&.sock
.RE
.PP
\fB\-x|\-\-script \fR\fB\fI<script>\fR\fR
@@ -146,6 +161,31 @@ Limits the total concurrent executions of
\fB\-x|\-\-script\fR\&. A value of 0 means no limit\&.
.RE
.PP
+\fB\-p|\-\-children\-policy \fR\fB\fI(defer|drop|kill\-oldest)\fR\fR
+.RS 4
+Specifies what
+\fBdropnroll\fR
+should do when the client limit has been reached:
+.PP
+\fIdefer\fR
+.RS 4
+defer the execution of
+\fB\-\-script\fR
+until the number of children is below the limit
+.RE
+.PP
+\fIdrop\fR
+.RS 4
+ingore the new file and don\(cqt call
+\fB\-\-script\fR
+.RE
+.PP
+\fIkill\-oldest\fR
+.RS 4
+kill the oldest child (using SIGKILL)
+.RE
+.RE
+.PP
\fB\-d|\-\-dir \fR\fB\fI<path>\fR\fR
.RS 4
Add
@@ -183,7 +223,7 @@ Remove the path from the list of directories\&. If the command succeds nothing i
Returns the complete list of all directories of the watch list\&.
.RE
.PP
-\fBlisten [request|status|none]\fR
+\fBlisten (request|status|none)\fR
.RS 4
Add the client to the status and or request listeners\&. When no parameter is passed to this command the client listens to all messages\&. A status listener gets a list of all directories whenever somebody else adds or removes a path to the watch list\&. It also receives the list when somebody sends a status command to the daemon\&. A request listener also receives add and remove requests by other clients connected to the command interface\&.
.RE
diff --git a/doc/dropnroll.8.txt b/doc/dropnroll.8.txt
index e9e4b86..0a8993d 100644
--- a/doc/dropnroll.8.txt
+++ b/doc/dropnroll.8.txt
@@ -19,9 +19,11 @@ dropnroll
[ -C|--chroot <path> ]
[ -P|--write-pid <filename> ]
[ -L|--log <target>:<level>[,<param1>[,<param2>[..]]] ]
+ [ -U|--debug ]
[ -s|--command-sock <unix sock> ]
[ -x|--script <script> ]
[ -m|--max-children <#of children> ]
+ [ -p|--children-policy (defer|drop|kill-oldest) ]
[ -d|--dir <path> ]
....
@@ -76,9 +78,17 @@ The following options can be passed to the *dropnroll* daemon:
'stdout';; log to standard output, parameters <level>
'stderr';; log to standard error, parameters <level>
+*-U, --debug*::
+ This option instructs *dropnroll* to run in debug mode. It implicits *-D*
+ (don't daemonize) and adds a log target with the configuration
+ 'stdout:5' (logging with maximum level). In future releases there might
+ be additional output when this option is supplied.
+
*-s|--command-sock '<unix sock>'*::
*dropnroll* will listen on this unix socket for incoming commands. See next
- chapter for details. The default is /var/run/dropnroll/cmd.sock
+ chapter for details. If there are directories specified using the *--dir*
+ option and this is kept empty the command socket is deactivated. If no directories
+ are added it defaults to /var/run/dropnroll/cmd.sock
*-x|--script '<script>'*::
The script which should be called when a new file is found. The following parameter
@@ -94,6 +104,13 @@ The following options can be passed to the *dropnroll* daemon:
*-m|--max-children '<#of children>'*::
Limits the total concurrent executions of *-x|--script*. A value of 0 means no limit.
+*-p|--children-policy '(defer|drop|kill-oldest)'*::
+ Specifies what *dropnroll* should do when the client limit has been reached:
+
+ 'defer';; defer the execution of *--script* until the number of children is below the limit
+ 'drop';; ingore the new file and don't call *--script*
+ 'kill-oldest';; kill the oldest child (using SIGKILL)
+
*-d|--dir '<path>'*::
Add '<path>' to the watch list. This can be invoked serveral times.
@@ -120,7 +137,7 @@ All commands have to end with '\n'. The following commands are supported:
*status*::
Returns the complete list of all directories of the watch list.
-*listen [request|status|none]*::
+*listen (request|status|none)*::
Add the client to the status and or request listeners. When no parameter is passed to
this command the client listens to all messages.
A status listener gets a list of all directories whenever somebody else adds or removes
diff --git a/src/options.c b/src/options.c
index d3824a9..9454443 100644
--- a/src/options.c
+++ b/src/options.c
@@ -286,7 +286,7 @@ void options_print_usage()
printf(" [-s|--command-sock] <unix sock> the command socket e.g. /var/run/dropnroll/cmd.sock\n");
printf(" [-x|--script] <script> the command socket e.g. newfile.sh\n");
printf(" [-m|--max-children] <#of children> limit of children to be started e.g. 8\n");
- printf(" [-p|--children-policy] (defer,drop,kill-oldest)\n");
+ printf(" [-p|--children-policy] (defer|drop|kill-oldest)\n");
printf(" what to do when children limit exceeds\n");
printf(" [-d|--dir] <path> add a path to the watch list, can be invoked several times\n");
}