systemd unit files replaced the init script you were copying

RHEL 7 shipped with systemd last summer, Fedora has had it for years, and Debian jessie is frozen with it as the default — so the init script most of us have been copying between projects since 2009 is on its way out, whatever one thinks of the argument around it.

# /etc/systemd/system/queue-worker.service
[Unit]
Description=Queue worker
After=network.target mysql.service

[Service]
User=deploy
ExecStart=/usr/bin/php /var/www/app/bin/worker
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

The practical gain is that most of what an init script did by hand — PID files, backgrounding, the restart loop, dropping privileges — is now declarative, and the twenty lines of boilerplate that got copied wrong go away. Restart=always alone replaces a supervisor for simple cases. Ubuntu 14.04 is still Upstart, so anything targeting the current LTS needs both for a while yet.