cloudflare / tableflip

Graceful process restarts in Go
BSD 3-Clause "New" or "Revised" License
2.91k stars 148 forks source link

Not working with systemd as per docs #6

Closed mvrhov closed 6 years ago

mvrhov commented 6 years ago

Ubuntu Xenial (16.04) is the OS of choice, the command run is service <name> restart. The systemd stops and starts the process on restart.

[Service]
User=www-data
Group=www-data
Type=simple
Restart=on-failure
RestartSec=5s
RuntimeDirectory=MA
ExecStart=/path/to/executable serve --port=4001 --pid-file=/var/run/MA/foo.pid
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/var/run/MA/foo.pid

After the trial and error the only way to do seamples upgrade is to also add ExecReload=/bin/kill -HUP $MAINPID and then issue service <name> reload.

lmb commented 6 years ago

Yes, that's a great point. I didn't add this in the first place because ppl might use something other than signals to ask for an upgrade, but that makes this needlessly hard.

lmb commented 6 years ago

Please have a look at the PR and let me know if you think it's appropriate.