memcache开机启动 
#! /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=root
MAXCONN=1024
CACHESIZE=64
OPTIONS=""
if [ -f /etc/sysconfig/memcached ];then
    . /etc/sysconfig/memcached
fi
# Check that networking is up.
if [ "$NETWORKING" = "no" ]
then
    exit 0
fi
RETVAL=0
start () {
    echo "Starting memcached ..."
    # insure that /var/run/memcached has proper permissions
    chown $USER /usr/local/bin/memcached
    /usr/local/bin/memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/memcached.pid $OPTIONS
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/memcached
}
stop () {
    echo "Stopping memcached ..."
    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 $?
    3.将此脚本呢cp到/etc/init.d目录下并改名为memcached,然后执行chmod a+x memcached,如下:
    shell > cp memcached.sysv /etc/init.d/memcached
    shell > chmod 755 /etc/init.d/memcached
    4.将memcached加入系统服务:
    shell > chkconfig --add memcached
    shell > chkconfig memcached on
    5.以服务方式运行memcached
    shell > service memcached start
    以上如成功则重启下系统后查看下memcached是否已随系统启动
内容来源:http://cowbane.iteye.com/blog/970230