Skip to main content

Systemd services

Systemd is used as the so called “init system” on the Linux based Moduline controllers. A big part of its job is to manage so called services or daemons. These are tasks that are launched at boot or upon certain conditions that will run in the background.
If something needs to start up at every boot, making a service for it is a good way to achieve that goal. The main way to interact with these services is the systemctl tool, here are a couple of examples:
To make a service start right now use:

systemctl start your_service

Note that this only starts the service, next boot it will not run, for that it needs to be enabled:

systemctl enable your_service

Note that this will not start the service, to combine both tasks the --now option can be added:

systemctl enable --now your_service

This will start the service now and enable it for the future. This same pattern holds for disabling/stopping services, there we have:

systemctl stop your_service
systemctl disable your_service
systemctl disable --now your_service

There is also a restart option so you don’t have to run two commands:

systemctl restart your_service

This will first fully stop the service, then give it a clean start.

For more information use the help command:

systemctl --help

Go to Top