zoukankan      html  css  js  c++  java
  • 将redis添加到linux系统服务

    (1)

    [root@xiaofeibao ~]# find / -name redis
    /etc/redis
    /etc/logrotate.d/redis
    /etc/rc.d/init.d/redis
    /swoole-1.9.6/examples/redis
    /var/log/redis
    /var/run/redis
    /var/lib/redis

    (2)参考链接

    http://blog.csdn.net/justfor3l/article/details/53187795

    (3)

    [root@xiaofeibao ~]# vim /etc/rc.d/init.d/redis

    #!/bin/sh
    #
    # redis init file for starting up the redis daemon
    #
    # chkconfig: - 20 80
    # description: Starts and stops the redis daemon.

    # Source function library.
    . /etc/rc.d/init.d/functions

    name="redis-server"
    exec="/usr/sbin/$name"
    pidfile="/var/run/redis/redis.pid"
    REDIS_CONFIG="/etc/redis.conf"

    [ -e /etc/sysconfig/redis ] && . /etc/sysconfig/redis

    lockfile=/var/lock/subsys/redis

    start() {
    [ -f $REDIS_CONFIG ] || exit 6
    [ -x $exec ] || exit 5
    echo -n $"Starting $name: "
    daemon --user ${REDIS_USER-redis} "$exec $REDIS_CONFIG"
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
    }

    stop() {
    echo -n $"Stopping $name: "
    killproc -p $pidfile $name
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
    }

    restart() {
    stop
    start
    }

    reload() {
    false
    }

    rh_status() {
    status -p $pidfile $name
    }

    "/etc/rc.d/init.d/redis" 88L, 1490C

  • 相关阅读:
    线程---JDK查看线程
    如何处理js的跨域问题
    每日思考(2019/12/31)
    每日思考(2019/12/30)
    每日思考(2019/12/29)
    每日思考(2019/12/28)
    每日思考(2019/12/27)
    每日思考(2019/12/26)
    每日思考(2019/12/25)
    每日思考(2019/12/24)
  • 原文地址:https://www.cnblogs.com/choucat/p/7472157.html
Copyright © 2011-2022 走看看