Author: baggins                      Date: Wed Jan 18 12:39:13 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- attempt at init script for nullmailer

---- Files affected:
SOURCES:
   nullmailer.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/nullmailer.init
diff -u /dev/null SOURCES/nullmailer.init:1.1
--- /dev/null   Wed Jan 18 13:39:13 2006
+++ SOURCES/nullmailer.init     Wed Jan 18 13:39:08 2006
@@ -0,0 +1,64 @@
+#!/bin/sh
+# nullmailer - Simple relay-only mail transport agent
+#
+# chkconfig:   345 85 05
+# description: nullmailer - Simple relay-only mail transport agent
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/nullmailer ] && . /etc/sysconfig/nullmailer
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; 
then
+               msg_network_down "nullmailer"
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/nullmailer ]; then
+               msg_starting "nullmailer"
+                daemon "setuidgid nullmail /usr/sbin/nullmailer-send 2>&1 & | 
setuidgid nullmail dumblog -c /var/log/nullmailer &"
+                touch /var/lock/subsys/nullmailer
+       else
+               msg_already_running "nullmailer"
+       fi
+       ;;
+  stop)
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/nullmailer ]; then
+               msg_stopping "nullmailer"
+               busy
+                killproc nullmailer-send
+               rm -f /var/lock/subsys/nullmailer
+       else
+               msg_not_running "nullmailer"
+       fi
+       ;;
+  restart|force-reload)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  status)
+       status "nullmailer"
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to