From c94d3d1d717c07aa9a44e2fd83359c203d54e30e Mon Sep 17 00:00:00 2001 From: Louis van Belle Date: Tue, 6 Mar 2018 12:38:29 +0100 Subject: [PATCH] Thctlo patch msinit fix rotating (#165) * Fix bug, wrong use in systemd file syslog reports : [/lib/systemd/system/mailscanner.service:19] Executable path is not absolute, ignoring: no Removed the reload line from mailscanner.service file. * disable rotating sign when stopping or deadpid. --- common/usr/lib/MailScanner/init/ms-init | 57 +++++++++++++------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/common/usr/lib/MailScanner/init/ms-init b/common/usr/lib/MailScanner/init/ms-init index dd72f8a..bf9d501 100644 --- a/common/usr/lib/MailScanner/init/ms-init +++ b/common/usr/lib/MailScanner/init/ms-init @@ -212,21 +212,22 @@ do_stop() # process killed if [ $RETVAL -eq 0 ]; then + # disable rotating sign when stopping. # wait until it is gone. - s='-\|/'; - x=0 - i=0 - RETVAL=0 - while [ "$x" -lt 600 -a "$RETVAL" -eq 0 ]; do - ps wwp $PID | grep -q '[M]ailScanner': > /dev/null 2>&1 - RETVAL="$?" - x=$((x+1)); - i=$(( (i+1) %4 )) - printf "\r${s:$i:1}" - sleep .1 - done - printf "\r" - echo " " + #s='-\|/'; + #x=0 + #i=0 + #RETVAL=0 + #while [ "$x" -lt 600 -a "$RETVAL" -eq 0 ]; do + # ps wwp $PID | grep -q '[M]ailScanner': > /dev/null 2>&1 + # RETVAL="$?" + # x=$((x+1)); + # i=$(( (i+1) %4 )) + # printf "\r${s:$i:1}" + # sleep .1 + #done + #printf "\r" + #echo " " # Check again ps wwp $PID|grep -q '[M]ailScanner': > /dev/null 2>&1 @@ -301,19 +302,19 @@ do_deadpid() [ "$VERBOSE" != no ] && logger -i -p mail.notice "Found a possible dead PID. Stopping all $NAME rogue processes ..." kill -15 $(ps axww | grep '[M]ailScanner': | awk '{print $1}') > /dev/null 2>&1 # wait until they're gone. - s='-\|/'; - x=0 - i=0 - RETVAL=0 - while [ "$x" -lt 600 -a "$RETVAL" -eq 0 ]; do - ps axww | grep -q '[M]ailScanner': - RETVAL="$?" - x=$((x+1)); - i=$(( (i+1) %4 )) - printf "\r${s:$i:1}" - sleep .1 - done - printf "\r" + #s='-\|/'; + #x=0 + #i=0 + #RETVAL=0 + #while [ "$x" -lt 600 -a "$RETVAL" -eq 0 ]; do + # ps axww | grep -q '[M]ailScanner': + # RETVAL="$?" + # x=$((x+1)); + # i=$(( (i+1) %4 )) + # printf "\r${s:$i:1}" + # sleep .1 + #done + #printf "\r" # Check again if [ $(ps axww | grep -q '[M]ailScanner': ) ]; then @@ -668,4 +669,4 @@ case "$1" in exit 3 ;; esac -exit 0 \ No newline at end of file +exit 0