Operations grimoire/Services
From Nasqueron Agora
Systemd, rc and runit
Nasqueron infrastructure uses 3 services software:
OS | Use case | Software | Commands |
---|---|---|---|
FreeBSD | Standard | rc | service <service> <command> |
Linux | Standard | systemd | systemctl <command> <service> |
Linux | Docker containers | runit | sv <service> <command> |
Note how systemd inverts the general order by putting the command before the service.
Systemd
Services
Search for .service file in operations repository for an idea. It's well documented on ArchLinux wiki and freedesktop.org site.
References:
- https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html
- https://wiki.archlinux.org/title/Systemd
Timers
- Generally better to use a systemd service and a systemd timer than a crontab entry on Linux
- Don't forget to start the timer, see this comment on D3674 for a demonstration
Howto for operations repository
You can follow this tutorial to deploy a service on Nasqueron infrastructure, it covers the step from software deployment, configuration, user creation and a systemd service.
FreeBSD rc
Template for operations repository
If you need to add a rc service, we've a template for the file: follow D3571 instructions