标签:shell
#!/bin/sh
#
# memcached: MemCached Daemon
#
# chkconfig: - 90 25
# description: MemCached Daemon
#
# Source function library.
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
#[ ${NETWORKING} = "no" ] && exit 0
#[ -r /etc/sysconfig/dund ] || exit 0
#. /etc/sysconfig/dund
#[ -z "$DUNDARGS" ] && exit 0
start()
{
echo -n $"Starting memcached: "
daemon $MEMCACHED -d -m 1024 -u root -p 12001 -P /opt/memcache/memcached.pid
echo
}
stop()
{
echo -n $"Shutting down memcached: "
#killproc memcached
kill `cat /opt/memcache/memcached.pid`
echo
}
MEMCACHED="/usr/local/bin/memcached"
[ -f $MEMCACHED ] || exit 1
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 3
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
标签:shell
原文地址:http://520tom.blog.51cto.com/530608/1630984