Skip to content

Instantly share code, notes, and snippets.

@ltvolks
Last active December 10, 2015 19:08
Show Gist options
  • Select an option

  • Save ltvolks/4479163 to your computer and use it in GitHub Desktop.

Select an option

Save ltvolks/4479163 to your computer and use it in GitHub Desktop.
Redis upstart script (slightly modified from PPA: https://launchpad.net/~rwky/+archive/redis)
# redis-server - Redis Datastore Server
#
# Redis is a key value in memory persistent datastore
# . Assumes certain config options:
#
# * bind 127.0.0.1
# * daemonize yes
# * pid, data, log, and config directories are expected to live in: /var/run/redis/redis.pid, /var/lib/redis/ , /var/log/redis/, /etc/redis/redis.conf
description "Redis server"
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345])
stop on runlevel [016]
respawn
expect fork
limit nofile 20000 65000
pre-start script
mkdir -p /var/{run/redis,lib/redis,log/redis}
chown redis:redis /var/{run/redis,lib/redis,log/redis}
end script
exec start-stop-daemon --start --chuid redis:redis --pidfile /var/run/redis/redis.pid --umask 007 --exec /usr/local/bin/redis-server -- /etc/redis/redis.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment