initial checkin

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@410 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2008-07-25 22:36:33 +00:00
parent 703b7cfb74
commit fd6579dd3c
5 changed files with 105 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
# /etc/conf.d/inoticoming
#
# for an explanation of options and actions, see inoticoming(1)
# user to run inoticoming as
USER=inoticoming
# log to some file instead of syslog
# required if you want to use --stdout-to-log or --stderr-to-log in actions
LOGFILE="/var/log/inoticoming.log"
# first search the directory for files already existing
# 0 for false, 1 for true
INITIALSEARCH=0
# directory to monitor
DIR=/var/spool/incoming
# actions
BASEDIR=/var/cache/reprepro/local
RULENAME=incoming
ACTIONS="--suffix .changes --stderr-to-log reprepro -s -b $BASEDIR --waitforlock 1000 processincoming $RULENAME {} ;"

View File

@@ -0,0 +1,47 @@
#!/sbin/runscript
DAEMON=/usr/bin/inoticoming
PIDFILE=/var/run/inoticoming.pid
depend() {
use net
after logger
}
checkconfig() {
if [ ! -d "$DIR" ] ; then
eerror "Incoming $DIR has not been configured."
eend 1
return 1
fi
}
start() {
checkconfig || return 1
ebegin "Starting incoming queue monitor"
# make sure inoticoming can write the PID to $PIDFILE
[ -f $PIDFILE ] || touch $PIDFILE
chown $USER $PIDFILE
OPTIONS="--pid-file $PIDFILE"
# make sure inoticoming can write to $LOGFILE
if [ -n $LOGFILE ] ; then
[ -f $LOGFILE ] || touch $LOGFILE
chown $USER $LOGFILE
OPTIONS="$OPTIONS --logfile $LOGFILE"
fi
# should we do an initial search of the directory?
[ "$INITIALSEARCH" != "0" ] && OPTIONS="$OPTIONS --initialsearch"
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --chuid $USER -- \
$OPTIONS $DIR $ACTIONS
eend $?
}
stop() {
checkconfig || return 1
ebegin "Stopping incoming queue monitor"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
eend $?
}