vim /etc/init.d/memcached
#!/bin/bash
# author:kuangl
# date:2013-05-30
# description: Starts and stops the Memcached services.
# pidfile: /tmp/memcached1.pid
# config: /usr/local/memcached
# chkconfig: - 55 45
# source function library
. /etc/rc.d/init.d/functions
memcached="/usr/local/bin/memcached"
[ -e $memcached ] || exit 1
start()
{
echo "Starting memcached:"
daemon $memcached -d -m 1000 -u root -l 127.0.0.1 -p 11211 -c 1500 -P /tmp/memcached1.pid
}
stop()
{
echo "Shutting down memcached"
pkill memcached
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
2017-05-10
memcached 启动停止脚本
评论
发表评论
姓 名: