Starting with systemd

The harbringer of doom

When I think of systemd, I think of:

systemd is still hungry

Although the gif is hilarious I tend to agree that one abstraction to rule them all is likely a road to disaster. But that's a flame war for another day.

Casual usage of systemd

So I just rebuilt my website, and took the chance to upgrade my server as well. Now I'm running Debian 8.5 and with it, systemd.

So my primary question was: How do I run my webapp with systemd ?

Turns out it's pretty simple. First, create a systemd service file: geekingfrog.service

Description=Geekingfrog website

ExecStart=/home/greg/website/geekingfrog 8080


and copy this file to /lib/systemd/system/geekingfrog.service. A symlink won't work. With a symlink, trying to enable the service will give:

Failed to execute operation: No such file or directory

To check if the service is correctly picked up by systemd:

systemctl status geekingfrog.service

To start it at system boot, it needs to be enabled, and then manually started:

systemctl enable geekingfrog.service
systemctl start geekingfrog

Useful links

Some useful links to start with systemd: