Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/share/doc/runit/html/ drwxr-xr-x | |
| Viewing file: Select action/file-type: runit runit - runlevelsPrepare runit for using runlevels Switching runlevels Creating runlevels Prepare runitIf not yet done, configure your system to use runit as process no 1 by following the instructions.Create the following directories and symbolic links: # mkdir -p /etc/runit/runsvdir/default # mkdir -p /etc/runit/runsvdir/single # ln -s /etc/sv/getty-5 /etc/runit/runsvdir/single/ # ln -s default /etc/runit/runsvdir/currentCopy the contents of /service/ to /etc/runit/runsvdir/current/ and replace /service/ with a symbolic link:
# cp -pR /service/* /etc/runit/runsvdir/current/
# mv -f /service /service.old && \
ln -s /etc/runit/runsvdir/current /service
You have now created two runlevels: default and single.
The current runlevel is default.
It is safe to remove /service.old/ if you don't need it anymore.
Finally edit /etc/runit/2 to set the default runlevel when stage 2 starts: $ cat /etc/runit/2 #!/bin/sh PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin runsvchdir default >/dev/null exec env - PATH=$PATH \ runsvdir /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' Switching runlevelsSwitching runlevels with runit is done by switching the directory the runsvdir program is running in. This is done by the runsvchdir program, e.g. to switch to the single user runlevel, do:# runsvchdir singleTo switch back to the default runlevel, do: # runsvchdir defaultSee the runsvdir program for a description of what happens when runsvdir sees the directory changed. Note that there is no guarantee that all services from the previous runlevel will stop, the runsv processes have sent the service daemons a SIGTERM and wait for them to terminate. You can check the status of the previous runlevel through /etc/runit/runsvdir/previous/. Creating new runlevelsTo create a new runlevel, simply create a new directory in /etc/runit/runsvdir/. The name of the directory is the name of the new runlevel. The name must not start with a dot and must not be current, current.new, or previous, e.g.:# mkdir /etc/runit/runsvdir/maintenanceAdd the services you want to run in the runlevel maintenance to the newly created directory, e.g.: # ln -s /etc/sv/getty-5 /etc/runit/runsvdir/maintenance/ # ln -s /etc/sv/ssh /etc/runit/runsvdir/maintenance/ # ln -s /etc/sv/dnscache /etc/runit/runsvdir/maintenance/If you want to switch to the runlevel maintenance, do: # runsvchdir maintenance Gerrit Pape <pape@smarden.org> |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0195 ]-- |