-
-
Save shahzaibalikhan/d0729b407dc7a3820f4c7b73e0e32e4f to your computer and use it in GitHub Desktop.
Ubuntu systemd service file for Redis. The server was updated to a Ubuntu 15.04 (Vivid Vervet) distribution. Redis was installed from the PPA from Roman Wookey (https://launchpad.net/~rwky/+archive/ubuntu/redis). After the switch to systemd instead of Upstart, Redis was not started by default. So I've hacked the following systemd config file. It…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Redis Datastore Server | |
After=network.target | |
[Service] | |
Type=forking | |
PIDFile=/var/run/redis/redis.pid | |
ExecStartPre=/bin/mkdir -p /var/run/redis | |
ExecStartPre=/bin/chown redis:redis /var/run/redis | |
ExecStart=/sbin/start-stop-daemon --start --chuid redis:redis --pidfile /var/run/redis/redis.pid --umask 007 --exec /usr/bin/redis-server -- /etc/redis/redis.conf | |
ExecReload=/bin/kill -USR2 $MAINPID | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With systemd, the package (.deb or .rpm) should install the *.service file in /lib/systemd/system/ (Ubuntu) or in the /usr/lib/systemd/system/ (RHEL) directory. So the script above should go into /lib/systemd/system/. - akbarahmed