diff --git a/c_micasad/startup/installcasa b/c_micasad/startup/installcasa index d14ad69d..6a455e67 100755 --- a/c_micasad/startup/installcasa +++ b/c_micasad/startup/installcasa @@ -1,6 +1,5 @@ -#!/bin/bash # enable the service -insserv -d /etc/init.d/micasad +insserv -d /etc/init.d/micasad >/dev/null 2>&1 # install PAM modules (/usr/sbin/casacfgpam) RCODE=$? @@ -8,5 +7,6 @@ if(test $RCODE != 0) then exit $RCODE else +/etc/init.d/micasad restart >/dev/null 2>&1 exit 0 fi diff --git a/c_micasad/startup/micasad b/c_micasad/startup/micasad index 631d8ca8..7158c914 100644 --- a/c_micasad/startup/micasad +++ b/c_micasad/startup/micasad @@ -12,6 +12,9 @@ # Description: miCASA daemon ### END INIT INFO MICASAD_BIN=/usr/sbin/micasad.sh +MICASAD_PID=/var/run/micasad.pid +MICASAD_MONO=/usr/bin/mono + test -x $MICASAD_BIN || exit 5 . /etc/rc.status @@ -37,9 +40,7 @@ case "$1" in ;; stop) echo "Shutting down micasad " - #killproc -TERM $MICASAD_BIN - pid=`cat /var/run/micasad.pid` >/dev/null 2>&1 - kill -s TERM $pid >/dev/null 2>&1 + killproc -p $MICASAD_PID -TERM $MICASAD_MONO # Remember status and be verbose rc_status -v @@ -87,23 +88,7 @@ case "$1" in ;; status) echo "Checking micasad service ..." - /sbin/checkproc micasad - res=$? - if [ $res == 0 ] - then - echo -n "0 - service up and running" - elif [ $res == 1 ] - then - echo -n "1 - service running under mono, /var/run/pid file exists" - elif [ $res == 2 ] - then - echo -n "2 - service status unknown, /var/lock/lock file exists" - elif [ $res == 3 ] - then - echo -n "3 - service not running" - else - echo -n "service status unknown" - fi + checkproc -p $MICASAD_PID $MICASAD_BIN rc_status -v ;; diff --git a/c_micasad/startup/uninstallcasa b/c_micasad/startup/uninstallcasa index 3ebab0df..5b3fed35 100755 --- a/c_micasad/startup/uninstallcasa +++ b/c_micasad/startup/uninstallcasa @@ -1,6 +1,6 @@ -#!/bin/bash #disable the service -insserv -r /etc/init.d/micasad +/etc/init.d/micasad stop >/dev/null 2>&1 +insserv -r /etc/init.d/micasad >/dev/null 2>&1 # uninstall PAM modules (/usr/sbin/casaucfgpam) RCODE=$?