Skip to content

Instantly share code, notes, and snippets.

@sshymko
Last active May 8, 2024 14:56
Show Gist options
  • Save sshymko/898aee7d0ec0e3d2a8a41f0956756530 to your computer and use it in GitHub Desktop.
Save sshymko/898aee7d0ec0e3d2a8a41f0956756530 to your computer and use it in GitHub Desktop.
Redis service for systemd on Linux
[Unit]
Description=Redis persistent key-value storage
After=network.target
[Service]
Type=notify
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd --daemonize no
ExecStop=/usr/bin/redis-cli -p 6379 shutdown
ExecReload=/bin/kill -USR2 $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
@crussell52
Copy link

crussell52 commented Oct 15, 2021 via email

@sshymko
Copy link
Author

sshymko commented Oct 15, 2021

@crussell52
The reason to include ExecStop was to distinguish Redis instances running on different ports.
But looks like you're right, omitting the stop command will work in this case as well.

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