aboutsummaryrefslogtreecommitdiff
path: root/network/amavisd-new/rc.amavisd-new
diff options
context:
space:
mode:
authorNishant Limbachia <nishant@mnspace.net>2012-06-02 19:50:58 -0400
committerErik Hanson <erik@slackbuilds.org>2012-06-03 15:21:14 -0500
commit3bf00bd0e2039b2e3e7b58e8bc3ade47be0ea2bf (patch)
tree9b722f1724d24bdf7ae9a35b6aa907ca75203edc /network/amavisd-new/rc.amavisd-new
parent5aa4cfd3470f9bf2abfa24df63c68b095f7c2e83 (diff)
network/amavisd-new: Updated for version 2.7.1.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'network/amavisd-new/rc.amavisd-new')
-rw-r--r--network/amavisd-new/rc.amavisd-new42
1 files changed, 30 insertions, 12 deletions
diff --git a/network/amavisd-new/rc.amavisd-new b/network/amavisd-new/rc.amavisd-new
index 9d0de3dd68ca4..3410eb18c26e1 100644
--- a/network/amavisd-new/rc.amavisd-new
+++ b/network/amavisd-new/rc.amavisd-new
@@ -1,31 +1,42 @@
#!/bin/sh
-# Copyright (c) 2008-2011, Nishant Limbachia, Hoffman Estates, IL, USA
-# <nishant _AT_ mnspace _DOT_ net>
-# /etc/rc.d/rc.amavisd
-# start|stop|restart|status for amavisd-new
-# For automatic start at boot up, call this script from rc.local
+# Startup script for amavisd-new daemon for use on Slackware Linux x86|x86_64
+
+# Copyright (c) 2008-2012, Nishant Limbachia, Hoffman Estates, IL, USA
+# [nishant _AT_ mnspace _DOT_ net]
+# Usage: /etc/rc.d/rc.amavisd-new start|stop|restart|reload|status
+# For automatic startup at boot, call this script from rc.local
PIDFILE=/var/run/amavis/amavisd.pid
amavisd_start() {
if [ -x /etc/rc.d/rc.amavisd-new ]; then
+ # start amavisd-signer first
+ echo "Starting amavisd-signer daemon"
+ /usr/sbin/amavisd-signer
+
if [ -f $PIDFILE ]; then
echo "amavisd-new daemon running with PID: $(cat $PIDFILE)"
- echo "try /etc/rc.d/rc.amavisd-new stop|restart"
+ echo "Or we may have a stale pid file from previous run"
+ echo "try /etc/rc.d/rc.amavisd-new stop|restart Or"
+ echo "remove the stale pid file and try starting again"
echo ""
exit 1
else
echo "Starting amavisd-new daemon"
- /usr/sbin/amavisd start
+ /usr/sbin/amavisd-new start
fi
fi
}
amavisd_stop() {
+ # stop amavisd-signer first
+ echo "Stopping amavisd-signer daemon"
+ pkill amavisd-signer
+
if [ -f $PIDFILE ]; then
echo "Stopping amavisd-new daemon"
- /usr/sbin/amavisd stop
+ /usr/sbin/amavisd-new stop
else
echo "amavisd-new daemon is not running"
fi
@@ -33,13 +44,17 @@ amavisd_stop() {
amavisd_restart() {
echo "Restarting amavisd-new daemon"
- amavisd_stop
- sleep 5
- amavisd_start
+ /usr/sbin/amavisd-new restart
+}
+
+amavisd_reload() {
+ echo "Reloading amavisd-new daemon"
+ /usr/sbin/amavisd-new reload
}
amavisd_status() {
echo "amavisd-new daemon running with PID: $(cat $PIDFILE)"
+ echo "amavisd-signer daemon running with PID: $(pgrep amavisd-signer)"
}
case "$1" in
@@ -52,11 +67,14 @@ case "$1" in
'restart')
amavisd_restart
;;
+'reload')
+ amavisd_reload
+ ;;
'status')
amavisd_status
;;
*)
- echo "USAGE: $0 start|stop|restart|status"
+ echo "USAGE: $0 start|stop|restart|reload|status"
exit 1
;;
esac