Operations grimoire/Services: Difference between revisions
Cat, intro |
→FreeBSD rc: Basic instructions |
||
| Line 36: | Line 36: | ||
== FreeBSD rc == | == FreeBSD rc == | ||
=== Structure of a rc configuration file === | |||
Each service is configured in /etc/rc.conf.d/<service> file or by all the files in /etc/rc.conf.d/<service>/ directory. | |||
Those files follow [https://man.freebsd.org/cgi/man.cgi?rc.conf rc.conf syntax] and use: | |||
* <service>_enable="YES" to indicate auto start of the service | |||
* various <service>_<key>=<value> per service documentation | |||
To know all the available options for a service the best is to read the documentation at the top of every service, located in | |||
/usr/local/etc/rc.d for applications and /etc/rc.d for the base system. | |||
=== Template for operations repository === | === Template for operations repository === | ||
If you need to add a rc service, we've a template for the file: follow [https://devcentral.nasqueron.org/D3571 D3571 instructions] | If you need to add a rc service, we've a template for the file: follow [https://devcentral.nasqueron.org/D3571 D3571 instructions] | ||
[[Category:Operations grimoire|Services]] | [[Category:Operations grimoire|Services]] | ||
Latest revision as of 20:50, 5 April 2026
Software running as daemons should be set as services to manage them at OS level a standard way.
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
Structure of a rc configuration file
Each service is configured in /etc/rc.conf.d/<service> file or by all the files in /etc/rc.conf.d/<service>/ directory.
Those files follow rc.conf syntax and use:
- <service>_enable="YES" to indicate auto start of the service
- various <service>_<key>=<value> per service documentation
To know all the available options for a service the best is to read the documentation at the top of every service, located in /usr/local/etc/rc.d for applications and /etc/rc.d for the base system.
Template for operations repository
If you need to add a rc service, we've a template for the file: follow D3571 instructions
