aboutsummaryrefslogtreecommitdiff
path: root/debian/mauvealert-server.init
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-07-13 16:02:50 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-07-13 16:02:50 +0100
commite140af144e987ff7f6d767f2dc48b9cf685803fd (patch)
tree4a01971890865b4b3ca837d563bc673cbb787de8 /debian/mauvealert-server.init
parentd28af4ec946c6aa4b645b73cef47d7e0c680bc0d (diff)
Big commit
* Added manpages for all binaries * Added log-reopening for mauvealert-server, and logrotate snippet * mauveserver now adds a user on install, and runs as that user * Big logging tidy-up * Alert subjects are only overwritten by the source, when the subject in the databse is empty * Removed various attr_writer methods that were being redifined * Added a notes box to the acknowledge form, but this doesn't work yet
Diffstat (limited to 'debian/mauvealert-server.init')
-rw-r--r--debian/mauvealert-server.init22
1 files changed, 17 insertions, 5 deletions
diff --git a/debian/mauvealert-server.init b/debian/mauvealert-server.init
index 1f0e57f..15c287b 100644
--- a/debian/mauvealert-server.init
+++ b/debian/mauvealert-server.init
@@ -32,8 +32,6 @@ SCRIPTNAME=/etc/init.d/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
-VERBOSE=1
-
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
@@ -48,9 +46,9 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --chuid $RUNASUSER --test > /dev/null \
|| return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --startas $DAEMON -- \
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --chuid $RUNASUSER --background --startas $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
@@ -95,10 +93,19 @@ do_reload() {
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME
return 0
}
+#
+# Function that sends a SIGUSR1 to reopen logfiles
+#
+do_reopenlogs() {
+ start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
@@ -128,6 +135,11 @@ case "$1" in
do_reload
log_end_msg $?
;;
+ reopen-logs)
+ log_daemon_msg "Re-opening logs for $DESC" "$NAME"
+ do_reopenlogs
+ log_end_msg $?
+ ;;
restart)
#
# If the "reload" option is implemented then remove the