systemd and systemctl
Description of the most basic commands for the service management system in Linux and Ubuntu in particular.
Description
systemd – system and service manager (services / units).
systemctl – command for monitoring and managing systemd services.
With systemd, you can create services that will automatically start on system startup or reboot.
An example of working with creating systemctl daemons.
Custom files
For each service, files are configured in accordance with its documentation.
An example of the location and creation of a service:
sudo nano /etc/systemd/system/celery.service
An example of the location and creation of a configuration for this service:
sudo nano /etc/systemd/celery.conf
Basic commands
After editing the file, reboot the daemon:
sudo systemctl daemon-reload
Then we restart the service:
sudo systemctl restart celery.service
Check service status:
sudo systemctl status celery.service
Check if the service has been added to startup:
sudo systemctl is-enabled celery.service
Add service to autostart:
sudo systemctl enable celery.service
Add the service to autorun and start immediately:
sudo systemctl enable –now celery.service
Remove service from autostart:
sudo systemctl disable celery.service