Memcached启动脚本
# chkconfig: 345 60 60 # description: The memcached daemon is a network memory cache service. # processname: memcached #!/bin/sh # Source function library. . /etc/rc.d/init.d/functions PORT=11211 USER=root MAXCONN=1024 CACHESIZE=5120 OPTIONS="" CACHE_HOME=/usr/local/bin # Check that networking is up. if [ "$NETWORKING" = "no" ] then exit 0 fi RETVAL=0 prog="memcached" start () { echo -n $"Starting $prog: " # insure that /var/run/memcached has proper permissions chown $USER $CACHE_HOME/memcached daemon $CACHE_HOME/memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P $CACHE_HOME/memcached.pid $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 /var/run/memcached.pid 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 $?
北丐洪七公--Jeff
Dignity comes from strength, strength comes from struggle!
本文版权归作者和博客园共有,欢迎转载,未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。