Enjoy Slackware 15.0!
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:slackware_admin:runit [2019/09/16 06:40 (UTC)] chrisabela Typos in Chapter 8 (runevels) are corrected |
howtos:slackware_admin:runit [2020/05/06 08:08 (UTC)] chrisabela [Startup and Shutdown] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Runit ====== | ====== Runit ====== | ||
- | ===== 1. Introduction ===== | + | ===== Introduction ===== |
runit is a UNIX init scheme with service supervision. It is a cross-platform Unix init scheme with service supervision, | runit is a UNIX init scheme with service supervision. It is a cross-platform Unix init scheme with service supervision, | ||
Line 11: | Line 11: | ||
To read on the benefits of runit, see here: http:// | To read on the benefits of runit, see here: http:// | ||
- | Unless otherwise stated, all commands in this article are to be run by root. | + | //* Unless otherwise stated, all commands in this article are to be run by root.// |
- | ===== 2. Use runit with traditional init ===== | + | ===== Use runit with traditional init (sysvinit) |
runit is not provided by Slackware, but a SlackBuild is maintained on https:// | runit is not provided by Slackware, but a SlackBuild is maintained on https:// | ||
Line 31: | Line 31: | ||
</ | </ | ||
- | For a typical Slackware-stlyle service, you can also edit ''/ | + | ==== Starting via rc.local ==== |
+ | |||
+ | For a typical Slackware-stlyle service, you can edit ''/ | ||
< | < | ||
Line 38: | Line 40: | ||
fi | fi | ||
</ | </ | ||
- | |||
- | if you require it. | ||
and then edit write ''/ | and then edit write ''/ | ||
Line 59: | Line 59: | ||
and reboot | and reboot | ||
- | ===== 3. Using runit with sysvinit and inittab | + | ==== Starting via inittab |
Remove the entries in ''/ | Remove the entries in ''/ | ||
Line 79: | Line 79: | ||
or reboot | or reboot | ||
- | ===== 4. How to replace init with runit ===== | + | ===== How to replace init with runit ===== |
+ | |||
+ | runit provides '' | ||
If you followed the previous chapter, then stop runsvdir and reverse all the changes that you made on your system. | If you followed the previous chapter, then stop runsvdir and reverse all the changes that you made on your system. | ||
Line 186: | Line 188: | ||
However, with the last alternative, | However, with the last alternative, | ||
- | ===== 5. Startup and Shutdown | + | ==== Startup and Shutdown ==== |
- | The traditional | + | The BSD style init scripts provided by Slackware are used to bring up the system. |
+ | |||
+ | Initially | ||
The script ''/ | The script ''/ | ||
Line 217: | Line 221: | ||
However consider that shutdown would not work for the original init. | However consider that shutdown would not work for the original init. | ||
- | ===== 6. runsv ===== | + | ===== runsv ===== |
Although runit may replace init as the PID 1 daemon, there is not much benefit unless other services are migrated from Slackware' | Although runit may replace init as the PID 1 daemon, there is not much benefit unless other services are migrated from Slackware' | ||
Line 324: | Line 328: | ||
Now bob can manage this service with the '' | Now bob can manage this service with the '' | ||
- | ===== 7. | + | ===== Managing Services with sv ===== |
To see the status of a supervised service use '' | To see the status of a supervised service use '' | ||
Line 344: | Line 348: | ||
</ | </ | ||
- | ==== 7.1. Stop/ | + | ==== Stop/ |
Start a service | Start a service | ||
Line 378: | Line 382: | ||
Each of these will also return the status of the service upon exit. | Each of these will also return the status of the service upon exit. | ||
- | ==== 7.2. Enabling a service ==== | + | ==== Enabling a service ==== |
Service directories are placed under ''/ | Service directories are placed under ''/ | ||
Line 388: | Line 392: | ||
Once a service is linked it will always start on boot and restart if it stops (unless this is disabled). | Once a service is linked it will always start on boot and restart if it stops (unless this is disabled). | ||
- | ==== 7.3. Disabling a service ==== | + | ==== Disabling a service ==== |
To disable a service in the current runlevel remove the symlink to its service directory from ''/ | To disable a service in the current runlevel remove the symlink to its service directory from ''/ | ||
Line 410: | Line 414: | ||
</ | </ | ||
- | ==== 7.4. Dependencies ==== | + | ==== Dependencies ==== |
Dependencies of service are supported by starting the dependent run script as follows: | Dependencies of service are supported by starting the dependent run script as follows: | ||
Line 422: | Line 426: | ||
</ | </ | ||
- | ===== 8. Runlevels | + | ==== Runlevels ==== |
If you installed the slackbuild configuration files, you have two runlevels: default and single. The current runlevel is default. You can verify by looking under ''/ | If you installed the slackbuild configuration files, you have two runlevels: default and single. The current runlevel is default. You can verify by looking under ''/ | ||
Line 446: | Line 450: | ||
You can edit the runsvdir line of ''/ | You can edit the runsvdir line of ''/ | ||
- | ===== 9. run scripts ===== | + | ===== Run scripts ===== |
Only one executable can be called for a service (the last line) and it must be called by the '' | Only one executable can be called for a service (the last line) and it must be called by the '' | ||
+ | |||
+ | Another set of installable run scripts are available at [[https:// | ||
In direct contrast to Slackware' | In direct contrast to Slackware' | ||
Line 458: | Line 464: | ||
</ | </ | ||
- | Or you can use the '' | + | Or you can use the '' |
< | < | ||
Line 464: | Line 470: | ||
</ | </ | ||
- | ===== 10. Migrating Services ===== | + | ===== Migrating Services ===== |
It is suggested that services are migrated from stage 2 (which are still under the Slackware' | It is suggested that services are migrated from stage 2 (which are still under the Slackware' | ||
Line 515: | Line 521: | ||
It is stuggested to let '' | It is stuggested to let '' | ||
- | ===== 11. Sources | + | ===== Using runit-init with other init scripts |
- | + | ||
- | (1) http://smarden.org/runit/ | + | ==== OpenRC ==== |
+ | |||
+ | Here '' | ||
+ | |||
+ | It requires a working OpenRC system. Check the [[howtos: | ||
+ | The level 1 runit service uses the OpenRC '' | ||
- | (2) https://slackbuilds.org | + | The [[https://wiki.gentoo.org/ |
- | (3) https:// | + | ==== void-runit ==== |
- | (4) https://voidlinux.org/usage/runit/ | + | Here the scripts provided by the [[https://github.com/void-linux/void-runit|void-runit]] project are used to mount the filesystem, load modules, etc. |
- | (5) https://www.youtube.com/ | + | Currently this is the most independent way to setup runit. |
- | (6) http:// | + | ===== Sources ===== |
- | (7) https:// | + | - http:// |
+ | - https:// | ||
+ | - https:// | ||
+ | - https:// | ||
+ | - http:// | ||
+ | - https:// | ||
+ | - https:// | ||
+ | - https:// | ||
+ | - https:// | ||
+ | - https:// | ||
- | (8) https:// | + | ---- |
* Written for Slackware 14.2 in December 2018 | * Written for Slackware 14.2 in December 2018 |