HEX
Server: nginx/1.22.0
System: Linux iZuf6jdxbygmf6cco977lcZ 5.10.84-10.4.al8.x86_64 #1 SMP Tue Apr 12 12:31:07 CST 2022 x86_64
User: root (0)
PHP: 7.4.29
Disabled: passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,fsocket,popen
Upload Files
File: //etc/rc1.d/K45memcached
#!/bin/sh
#
# chkconfig: - 55 45
# description:  The memcached daemon is a network memory cache service.
# processname: memcached
# config: /etc/sysconfig/memcached

# Source function library.
. /etc/rc.d/init.d/functions

PORT=11211
USER=memcached
MAXCONN=1024
CACHESIZE=447
OPTIONS="-l 127.0.0.1"
DAEMON=/usr/local/memcached/bin/memcached
PIDFILE=/var/run/memcached/memcached.pid
PIDDIR=`dirname $PIDFILE`

if [ "$NETWORKING" = "no" ]
then
  exit 0
fi

RETVAL=0
prog="memcached"

start() {
  echo -n $"Starting $prog: "
  # Make sure the default pidfile directory exists
  if [ ! -d $PIDDIR ]; then
    install -d -m 0755 -o $USER -g $USER $PIDDIR
  fi
  daemon $DAEMON -d -p $PORT -u $USER  -m $CACHESIZE -c $MAXCONN -P $PIDFILE $OPTIONS
  RETVAL=$?
  echo
  [ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
}
stop() {
  echo -n $"Stopping $prog: "
  killproc memcached
  RETVAL=$?
  echo
  if [ $RETVAL -eq 0 ] ; then
    rm -f /var/lock/subsys/memcached
    rm -f $PIDFILE
  fi
}

restart() {
  stop
  start
}


# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  status)
    status memcached
    ;;
  restart|reload)
    restart
    ;;
  condrestart)
    [ -f /var/lock/subsys/memcached ] && restart || :
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
    exit 1
esac

exit $?