From d0da009bb156ebb23975b2a1dc4749fe515d8b7d Mon Sep 17 00:00:00 2001 From: joborun linux Date: Fri, 18 Aug 2023 09:35:58 +0000 Subject: [PATCH] add start stop supervision example --- runit-setup.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/runit-setup.md b/runit-setup.md index c65d72f..92a167d 100644 --- a/runit-setup.md +++ b/runit-setup.md @@ -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: + +
+% ln -s /usr/lib/runit/sv/dhcpcd /etc/runit/runsvdir/default/
+
+ +This enables and starts starts the service "under the supervision of runit's runsvdir". + +To stop it and disable the same service as root: + +
+ % rm /etc/runit/runsvdir/default/dhcpcd
+
+ +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.