码迷,mamicode.com
首页 > 系统相关 > 详细

memcached 启动shell脚本

时间:2015-04-10 20:28:48      阅读:159      评论:0      收藏:0      [点我收藏+]

标签: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


memcached 启动shell脚本

标签:shell

原文地址:http://520tom.blog.51cto.com/530608/1630984

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!