Advertisement
blackbrd

/etc/rc.d/init.d/c-icap

Oct 14th, 2014
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.95 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # c-icap: Start/Stop c-icap
  4. # chkconfig: - 70 30
  5. # description: c-icap is an implementation of an ICAP server.
  6. # processname: c-icap
  7. # pidfile: /var/run/c-icap/c-icap.pid
  8.  
  9. ./etc/rc.d/init.d/functions
  10. ./etc/sysconfig/network
  11.  
  12. CONFIG_FILE=/etc/c-icap.conf
  13. PID_DIR=/var/run/c-icap
  14.  
  15. RETVAL=0
  16. start() {
  17.    echo -n $"Starting c-icap: "
  18.    daemon /usr/local/bin/c-icap -f $CONFIG_FILE
  19.    RETVAL=$?
  20.    echo
  21.    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/c-icap
  22.    return $RETVAL
  23. }
  24. stop() {
  25.    echo -n $"Stopping c-icap: "
  26.    killproc c-icap
  27.    rm -f /var/run/c-icap/c-icap.ctl
  28.    RETVAL=$?
  29.    echo
  30.    [ $RETVAL -eq 0 ] && rm -f $PID_DIR/c-icap.pid /var/lock/subsys/c-icap
  31.    return $RETVAL
  32. }
  33. case "$1" in
  34.    start)
  35.       start
  36.    ;;
  37.    stop)
  38.       stop
  39.    ;;
  40.    status)
  41.       status c-icap
  42.    ;;
  43.    restart)
  44.       stop
  45.       start
  46.    ;;
  47.    *)
  48.       echo $"Usage: $0 {start|stop|status|restart}"
  49.    exit 1
  50. esac
  51. exit $?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement