Skip to content

Instantly share code, notes, and snippets.

@calvinchengx
Created May 9, 2012 08:46
Show Gist options
  • Save calvinchengx/2643069 to your computer and use it in GitHub Desktop.
Save calvinchengx/2643069 to your computer and use it in GitHub Desktop.
systemd's [email protected]
# An alternative approach which is more "systemd" native
[email protected]:
[Unit]
Description=cherrypy server on port %i
[Service]
WorkingDirectory=/...
User=web
ExecStart=/.../manage.py runcpserver port=%i threads=1 request_queue_size=0 verbose=0
ExecStop=/.../manage.py runcpserver stop
[Install]
WantedBy=cpserver.target
---
mkdir /etc/systemd/system/cpserver.target.wants
ln -s /etc/systemd/system/[email protected] /etc/systemd/system/cpserver.target.wants/
ln -s /etc/systemd/system/[email protected] /etc/systemd/system/cpserver.target.wants/
ln -s /etc/systemd/system/[email protected] /etc/systemd/system/cpserver.target.wants/
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment