Skip to content

Instantly share code, notes, and snippets.

@borisguery
Last active July 4, 2017 09:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borisguery/3c5aee0005cb53e1de849fa7847196c9 to your computer and use it in GitHub Desktop.
Save borisguery/3c5aee0005cb53e1de849fa7847196c9 to your computer and use it in GitHub Desktop.
Disque install and systemd service configuration
[Unit]
Description=Disque Distributed Message Broker
After=network.target
[Service]
Type=forking
PIDFile=/var/run/disque/disque.pid
User=disque
Group=disque
Environment=statedir=/var/run/disque/
WorkingDirectory=/var/run/disque/
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p ${statedir}
ExecStartPre=/bin/mkdir -p /var/logs/disque
ExecStartPre=/bin/chown -R disque:disque ${statedir} /var/logs/disque
ExecStart=/usr/local/bin/disque-server /etc/disque/disque.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/usr/local/bin/disque shutdown
Restart=always
[Install]
WantedBy=multi-user.target
$ cd /tmp
$ git clone https://github.com/antirez/disque.git
$ cd disque/
$ make
$ make test
$ sudo make install
$ sudo useradd -M -r disque
$ mkdir /etc/disque/
$ cp disque.conf /etc/disque/
$ vi /etc/disque/disque.conf   # configure daemonize, pidfile, bind
$ sudo curl -so /etc/systemd/system/disque.service https://gist.githubusercontent.com/borisguery/3c5aee0005cb53e1de849fa7847196c9/raw/791e85a3d634dfc396b0ec4b55e3a52a5152af97/disque.service
$ sudo systemctl daemon-reload # reload systemd
$ sudo service disque start    # actually start the service
$ sudo service disque status   # ensure everything is running well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment