want to run redis-server in background nonstop

前端 未结 4 490
悲哀的现实
悲哀的现实 2021-01-30 04:57

I have downloaded redis-2.6.16.tar.gz file and i installed sucessfully. After installed i run src/redis-server it worked fine.

But i don\'t want manually run src/redis-s

4条回答
  •  情深已故
    2021-01-30 05:40

    I think the best way is to use Redis' config file:

    # By default Redis does not run as a daemon. Use 'yes' if you need it.
    # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
    daemonize yes
    

    Set daemonize to yes in the config file. Say the file is ~/.redis/redis.conf, then just run

    $ redis-server ~/.redis/redis.conf
    

    And it just works.

提交回复
热议问题