"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/scripts/memcached.sysv" (16 Jul 2020, 1414 Bytes) of package /linux/www/memcached-1.6.15.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.

    1 #! /bin/sh
    2 #
    3 # chkconfig: - 55 45
    4 # description:  The memcached daemon is a network memory cache service.
    5 # processname: memcached
    6 # config: /etc/sysconfig/memcached
    7 
    8 # Source function library.
    9 . /etc/rc.d/init.d/functions
   10 
   11 PORT=11211
   12 USER=nobody
   13 MAXCONN=1024
   14 CACHESIZE=64
   15 OPTIONS=""
   16 
   17 if [ -f /etc/sysconfig/memcached ];then
   18     . /etc/sysconfig/memcached
   19 fi
   20 
   21 # Check that networking is up.
   22 if [ "$NETWORKING" = "no" ]
   23 then
   24     exit 0
   25 fi
   26 
   27 RETVAL=0
   28 prog="memcached"
   29 
   30 start () {
   31     echo -n $"Starting $prog: "
   32     # insure that /var/run/memcached has proper permissions
   33     chown $USER /var/run/memcached
   34     daemon memcached -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P /var/run/memcached/memcached.pid $OPTIONS
   35     RETVAL=$?
   36     echo
   37     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
   38 }
   39 stop () {
   40     echo -n $"Stopping $prog: "
   41     killproc memcached
   42     RETVAL=$?
   43     echo
   44     if [ $RETVAL -eq 0 ] ; then
   45         rm -f /var/lock/subsys/memcached
   46         rm -f /var/run/memcached/memcached.pid
   47     fi
   48 }
   49 
   50 restart () {
   51     stop
   52     start
   53 }
   54 
   55 
   56 # See how we were called.
   57 case "$1" in
   58     start)
   59         start
   60         ;;
   61     stop)
   62     stop
   63     ;;
   64     status)
   65     status memcached
   66     ;;
   67     restart|reload)
   68     restart
   69     ;;
   70     condrestart)
   71     [ -f /var/lock/subsys/memcached ] && restart || :
   72     ;;
   73     *)
   74     echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
   75     exit 1
   76 esac
   77 
   78 exit $?