summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-19 16:54:31 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-04-19 16:54:31 +0100
commitc4581c05b1b7667d655b23612000d21fa700bfd3 (patch)
tree388f16da316340ce0cebb5160fb5670c1f0df7d2 /wallace
parent20b093ae09b9ad78c53141af958b129bdcc69cb7 (diff)
downloadpykolab-c4581c05b1b7667d655b23612000d21fa700bfd3.tar.gz
Add sysconfig, systemd and sysvinit files for Wallace
Diffstat (limited to 'wallace')
-rw-r--r--wallace/wallaced.sysconfig5
-rw-r--r--wallace/wallaced.systemd15
-rw-r--r--wallace/wallaced.sysvinit108
3 files changed, 128 insertions, 0 deletions
diff --git a/wallace/wallaced.sysconfig b/wallace/wallaced.sysconfig
new file mode 100644
index 0000000..7832bdb
--- /dev/null
+++ b/wallace/wallaced.sysconfig
@@ -0,0 +1,5 @@
+# Configuration file for the Kolab Server daemon Wallace.
+#
+# See wallaced --help for more flags.
+#
+FLAGS="--fork -l warning"
diff --git a/wallace/wallaced.systemd b/wallace/wallaced.systemd
new file mode 100644
index 0000000..73c16d7
--- /dev/null
+++ b/wallace/wallaced.systemd
@@ -0,0 +1,15 @@
+[Unit]
+Description=Wallace Content Filter
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/wallaced/wallaced.pid
+EnvironmentFile=/etc/sysconfig/wallace
+ExecStart=/usr/sbin/wallace $FLAGS
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/bin/kill -TERM $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/wallace/wallaced.sysvinit b/wallace/wallaced.sysvinit
new file mode 100644
index 0000000..3b545a9
--- /dev/null
+++ b/wallace/wallaced.sysvinit
@@ -0,0 +1,108 @@
+#! /bin/bash
+#
+# wallace Start/Stop the Kolab server daemon Wallace
+#
+# chkconfig: - 65 10
+# description: The Kolab Wallace server daemon is a content filtering daemon.
+# processname: wallaced
+
+### BEGIN INIT INFO
+# Provides: wallaced
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs $network
+# Short-Description: Start/Stop the Kolab Server daemon
+# Description: The Kolab Wallace server daemon is a content filtering daemon.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source our configuration file for these variables.
+FLAGS="--fork -l warning"
+
+if [ -f /etc/sysconfig/wallace ] ; then
+ . /etc/sysconfig/wallace
+fi
+
+RETVAL=0
+
+# Set up some common variables before we launch into what might be
+# considered boilerplate by now.
+prog=wallace
+path=/usr/sbin/wallaced
+lockfile=/var/lock/subsys/$prog
+pidfile=/var/run/wallace/wallaced.pid
+
+start() {
+ [ -x $path ] || exit 5
+ echo -n $"Starting $prog: "
+ daemon $DAEMONOPTS $path -p $pidfile $FLAGS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch $lockfile
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc $prog
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f $lockfile
+ return $RETVAL
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+force_reload() {
+ restart
+}
+
+rh_status() {
+ # run checks to determine if the service is running or use generic status
+ status -p $pidfile $prog
+}
+
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ start
+ ;;
+ stop)
+ rh_status_q || exit 0
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ reload)
+ rh_status_q || exit 7
+ reload
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ status)
+ rh_status
+ ;;
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 2
+esac
+
+exit $?