aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-04 05:37:38 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-05-04 05:37:38 +0000
commit5663888746b3b5e15ab795a1e2bfaae7b2cf768a (patch)
treee1ee007db83ea3832d450ae4d6e2df7010cfbed9 /etc
parent076f7df5c40dbc3c791f14e5f55568e46244c0f8 (diff)
downloadmailfromd-5663888746b3b5e15ab795a1e2bfaae7b2cf768a.tar.gz
mailfromd-5663888746b3b5e15ab795a1e2bfaae7b2cf768a.tar.bz2
SIGHUP instructs `mailfromd' to restart itself.
Remove UNIX socket after closing it. git-svn-id: file:///svnroot/mailfromd/trunk@1405 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.in21
1 files changed, 19 insertions, 2 deletions
diff --git a/etc/rc.in b/etc/rc.in
index 675dce4d..e027f70f 100755
--- a/etc/rc.in
+++ b/etc/rc.in
@@ -75,12 +75,26 @@ mailfromd_status() {
else
PID='[0-9][0-9]*'
fi
- $PS | grep "[0-9]:[0-9][0-9] $DAEMON " |
+ $PS | grep "[0-9]:[0-9][0-9] $DAEMON" |
while read pid tt stat time command
do
echo $pid $command
done |
- grep $1 "$PID $command"
+ grep $1 "$PID $DAEMON"
+}
+
+mailfromd_reload() {
+ echo "Reloading mailfromd..."
+ if mailfromd_status -q; then
+ PID=`head -n 1 $PIDFILE`
+ kill -HUP $PID 2>/dev/null
+ if [ ! -r $PIDFILE ]; then
+ sleep 1
+ test -r $PIDFILE || echo "mailfromd failed to reload" >&2
+ fi
+ else
+ echo "mailfromd is not running"
+ fi
}
mailfromd_configtest() {
@@ -147,6 +161,8 @@ mailfromd_macros() {
case $1 in
start) mailfromd_start;;
stop) mailfromd_stop;;
+reload)
+ mailfromd_reload;;
restart)
mailfromd_stop
sleep 1
@@ -164,6 +180,7 @@ usage: $0 COMMAND [OPTIONS]
COMMANDS are:
start Start the daemon.
stop Stop the running instance of the daemon.
+ reload Reload the daemon by sending SIGHUP to its running copy.
restart Restart the daemon.
status Display status of the running instance.
configtest [FILE] Check configuration file syntax. If FILE is not

Return to:

Send suggestions and report system problems to the System administrator.