diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-04 05:37:38 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-04 05:37:38 +0000 |
commit | 5663888746b3b5e15ab795a1e2bfaae7b2cf768a (patch) | |
tree | e1ee007db83ea3832d450ae4d6e2df7010cfbed9 /etc | |
parent | 076f7df5c40dbc3c791f14e5f55568e46244c0f8 (diff) | |
download | mailfromd-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-x | etc/rc.in | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -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 |