LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

runit

Cross-platform Unix init scheme with service supervision

TLDR

Start runit init
$ runit
copy
Run as stage 2
$ runsvdir -P [/etc/service]
copy
Check service status
$ sv status [service_name]
copy
Start service
$ sv start [service_name]
copy
Stop service
$ sv stop [service_name]
copy
Restart service
$ sv restart [service_name]
copy

SYNOPSIS

runit [options]sv command service

DESCRIPTION

runit is a Unix init scheme with service supervision. It's an alternative to systemd and SysV init.Three stages handle system boot. Stage 1 initializes, stage 2 runs services, stage 3 shuts down.Service directories contain run scripts. A simple executable script defines the service.Supervision restarts crashed services. Automatic recovery maintains system availability.Logging integrates with svlogd. Per-service log rotation and management.

CONFIGURATION

/etc/service/

Default service directory where symlinks to service definitions are placed. Each subdirectory represents a supervised service.
/etc/sv/
Service definition directory containing run scripts and optional log/run scripts for each service.
/etc/runit/1
Stage 1 script executed during system initialization before services start.
/etc/runit/2
Stage 2 script that starts the service supervisor (typically runsvdir).
/etc/runit/3
Stage 3 script executed during system shutdown for cleanup tasks.

COMMANDS

sv start SERVICE

Start service.
sv stop SERVICE
Stop service.
sv restart SERVICE
Restart service.
sv status SERVICE
Check status.
sv reload SERVICE
Send SIGHUP.
sv once SERVICE
Run once, no restart.

SERVICE STRUCTURE

- `/etc/service/name/run` - Service script- `/etc/service/name/log/run` - Logger script- `/etc/service/name/supervise/` - Status directory

INSTALL

sudo apt install runit
copy
sudo apk add runit
copy
brew install runit
copy
nix profile install nixpkgs#runit
copy

CAVEATS

Different from systemd syntax. Learning curve for run script creation. Less widespread than systemd.

HISTORY

runit was created by Gerrit Pape around 2004 as a lightweight init system. It's used by Void Linux as the default init and available on many distributions.

SEE ALSO

sv(1), runsv(1), runsvdir(1), svlogd(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid