Systemd user services - an alternative to Node process managers

Your process manager for NodeJS is super convenient. With a little more effort you can achieve the same convenience with just Linux and Systemd.

Systemd user services - an alternative to Node process managers

Systemd features an option to run a service as a normal user with "sudo" involved only in one step of installation.

This means you can start, stop, and enable startup on system boot all using only the privilege set of a normal user.

Ways to manage constantly running processes are numerous. There is PM2, there is StrongLoop PM backed by IBM, there is Forever and Nodemon. Beside these, systemd services are perfect for occasions when you don't want to install NodeJS on the server - for example because that would be the only application dependent on Node in the whole system.

Configurig such a service requires a bit of knowledge. Tools like PM2 or its conterpart from IBM may seem more approachable. The value of learning about Systemd user services lies in its remarkably wide applicability. Wherever Linux is - even on a tiniest machine - you will likely find Systemd, ready to handle your services out of the box. That's the power that comes from knowing the standard tools.

To get to know more about Systemd user services, see this post by Brendan Long.

Subscribe to SBCTricks.com

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe