"Fossies" - the Fresh Open Source Software Archive

Member "elog-3.1.4-3/elogd.init_template" (26 Feb 2020, 1453 Bytes) of package /linux/www/elog-3.1.4-3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "elogd.init_template": 3.1.4-2_vs_3.1.4-3.

    1 #!/bin/sh
    2 
    3 # chkconfig: 3 90 10
    4 # description: ELOG is a weblog with integrated database
    5 # processname: elogd
    6 # config: @PREFIX@/elog/elogd.cfg
    7 # pidfile: /var/run/elogd.pid
    8 
    9 # RHEL
   10 [ -f /etc/init.d/functions ] && . /etc/init.d/functions
   11 
   12 # Check for the config file
   13 if [ ! -f @PREFIX@/elog/elogd.cfg ]; then
   14     exit 0
   15 fi
   16 
   17 
   18 # See how we were called.
   19 case "$1" in
   20   start)
   21         if [ -f /var/run/elogd.pid ] ; then
   22        pid=`cat /var/run/elogd.pid`
   23        if [ -d /proc/$pid ] ; then
   24          echo "elogd already running"
   25          # echo_failure
   26          exit 1
   27        fi
   28     fi
   29         if [ -f /var/run/elogd.pid ] ; then
   30            rm -f /var/lock/subsys/elogd
   31        rm -f /var/run/elogd.pid
   32         fi
   33     echo -n "Starting elogd: "
   34     @PREFIX@/sbin/elogd -D -c @PREFIX@/elog/elogd.cfg  > /dev/null 2>&1 
   35     RETVAL=$?
   36         if [ $RETVAL -eq 0  ] ; then 
   37           touch /var/lock/subsys/elogd
   38       echo_success
   39     else
   40       echo_failure
   41         fi
   42     echo
   43     ;;
   44   stop)
   45      echo ""
   46       if [ -f /var/run/elogd.pid ] ; then
   47         echo -n "Stoping elogd: "
   48         /bin/kill `cat /var/run/elogd.pid`
   49         rm -f /var/lock/subsys/elogd
   50     rm -f /var/run/elogd.pid
   51         echo_success
   52         echo
   53      else
   54         echo -n "No elogd running?"
   55     echo
   56      fi
   57      
   58     ;;
   59   status)
   60      status -p /var/run/elogd.pid /usr/local/sbin/elogd
   61      RETVAL=$?
   62         ;;
   63   restart|reload)
   64     $0 stop
   65     sleep 1
   66     $0 start
   67     ;;
   68   *)
   69     echo "Usage: $0 {start|stop|status|restart}"
   70     exit 1
   71 esac
   72 
   73 exit 0
   74