add start stop supervision example

This commit is contained in:
joborun linux 2023-08-18 09:35:58 +00:00
parent 23aaeeb8f0
commit d0da009bb1
1 changed files with 24 additions and 0 deletions

View File

@ -17,6 +17,30 @@
Last, we have made no changes to the stage 1 contents and setup. Just like artix and very similar to void's setup, anything affecting runit's stage 1 can be found in /etc/rc where 1,2,3 are defined.
#### To enable and start a service/daemon ####
Let us take dhcpcd as an example:
The service scripts for dhcpcd are stored in /usr/lib/runit/sv
The directory that runit parses to supervise services is /etc/runit/runsvdir/default
As root:
<pre>
% ln -s /usr/lib/runit/sv/dhcpcd /etc/runit/runsvdir/default/
</pre>
This enables and starts starts the service "under the supervision of runit's runsvdir".
To stop it and disable the same service as root:
<pre>
% rm /etc/runit/runsvdir/default/dhcpcd
</pre>
This is how simple things are. You link the service scripts to the catch-all runsvdir directory and runit starts and supervises its running (one shot services are executed once per session).
#### Services and service scripts ####
As we don't promote handholding and system administration from above, the existence of runit service scripts don't come with their corresponding dependencies, with the exception of dhclient, wpa_supplicant, ntp, and dbus, which are part of the base package. For all other services to actually run, not only do you have to link the service file to runsvdir, you must also install the corresponding package that is run by the service manager. In other words, if you want sddm as a display manager, the service script is there and you can enable it, but you must also install sddm itslef.