Skip to content

Instantly share code, notes, and snippets.

@geschke
Last active January 10, 2021 20:11
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save geschke/ab6afa91b2d9dfcd5c25 to your computer and use it in GitHub Desktop.
Save geschke/ab6afa91b2d9dfcd5c25 to your computer and use it in GitHub Desktop.
WARNING. OUTDATED! The information on this page is severely out of date. Don't use it! 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,…
[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
@tharun208
Copy link

What configuration should I add in the [Unit] section to make the service-disabled by default. Or any other options to make this by code will be really helpful

@geschke
Copy link
Author

geschke commented Jan 10, 2021

Just a remark: The original gist is really, really old. Ubuntu has reached the 20.10 version, so today these hints are outdated.
If you want to handle a systemd service, read the instructions for systemctl. To disable a service, a command like
"sudo systemctl disable " will be used.
And/or use Google to search for recent documentation, there are plenty of websites which describe systemd/systemctl, e.g. here: https://linoxide.com/linux-how-to/enable-disable-services-ubuntu-systemd-upstart/

Thanks & Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment