{"action":"closed","issue":{"url":"https://api.github.com/repos/getsentry/sentry/issues/3301","repository_url":"https://api.github.com/repos/getsentry/sentry","labels_url":"https://api.github.com/repos/getsentry/sentry/issues/3301/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/sentry/issues/3301/comments","events_url":"https://api.github.com/repos/getsentry/sentry/issues/3301/events","html_url":"https://github.com/getsentry/sentry/issues/3301","id":156371181,"number":3301,"title":"Systemd service files (documentation)","user":{"login":"LordMike","id":1027111,"avatar_url":"https://avatars.githubusercontent.com/u/1027111?v=3","gravatar_id":"","url":"https://api.github.com/users/LordMike","html_url":"https://github.com/LordMike","followers_url":"https://api.github.com/users/LordMike/followers","following_url":"https://api.github.com/users/LordMike/following{/other_user}","gists_url":"https://api.github.com/users/LordMike/gists{/gist_id}","starred_url":"https://api.github.com/users/LordMike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LordMike/subscriptions","organizations_url":"https://api.github.com/users/LordMike/orgs","repos_url":"https://api.github.com/users/LordMike/repos","events_url":"https://api.github.com/users/LordMike/events{/privacy}","received_events_url":"https://api.github.com/users/LordMike/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-23T21:29:40Z","updated_at":"2016-05-25T16:38:59Z","closed_at":"2016-05-25T16:38:59Z","body":"Hi,\r\n\r\nAfter having followed your excellent guide (really, kudos on that. It's almost copy-paste and then run) a few times, I've now written the same `systemd` service files two or three times. Do you have systemd documentation or would you like it?\r\n\r\nI've created 3 systemd service files in my `Ubuntu 16.04`'s `/etc/systemd/system` directory, as shown below. This allows me to `systemctl enable sentry-web` (and the other two) as well as `service sentry-web status|start|stop`. SystemD keeps track of PID files, stopping services on shutdown (because you elegantly respond to `SIGTERM`).\r\n\r\nThe files are a start and work in my installation. They may need more in terms of `[Install]` or other options. I haven't handled the virtualenv besides setting `WorkingDirectory`, but it doesn't seem like it's needed.\r\n\r\n**sentry-web.service**\r\n\r\n    [Unit]\r\n    Description=Sentry Main Service\r\n    After=network.target\r\n    Requires=sentry-beat.service\r\n    Requires=sentry-worker.service\r\n    \r\n    [Service]\r\n    Type=simple\r\n    User=sentry\r\n    Group=sentry\r\n    WorkingDirectory=/www/sentry\r\n    Environment=SENTRY_CONF=/etc/sentry\r\n    ExecStart=/www/sentry/bin/sentry run web\r\n\r\n**sentry-beat.service**\r\n\r\n    [Unit]\r\n    Description=Sentry Beat Service\r\n    After=network.target\r\n    \r\n    [Service]\r\n    Type=simple\r\n    User=sentry\r\n    Group=sentry\r\n    WorkingDirectory=/www/sentry\r\n    Environment=SENTRY_CONF=/etc/sentry\r\n    ExecStart=/www/sentry/bin/sentry celery beat\r\n\r\n\r\n**sentry-worker.service**\r\n\r\n    [Unit]\r\n    Description=Sentry Background Worker\r\n    After=network.target\r\n    \r\n    [Service]\r\n    Type=simple\r\n    User=sentry\r\n    Group=sentry\r\n    WorkingDirectory=/www/sentry\r\n    Environment=SENTRY_CONF=/etc/sentry\r\n    ExecStart=/www/sentry/bin/sentry celery worker"}}
{"actor":{"display_login":"LordMike"}}