Skip to content

Instantly share code, notes, and snippets.

@AmaranthLIS
Created August 23, 2017 10:18
Show Gist options
  • Save AmaranthLIS/7ba4ccd03a6f48a6493423b5296adaae to your computer and use it in GitHub Desktop.
Save AmaranthLIS/7ba4ccd03a6f48a6493423b5296adaae to your computer and use it in GitHub Desktop.
runit
sv s /service/*
Stops a service immediately (would still start on next boot):
# sv d ssh
Restarts a service:
# sv t ssh
# sv i postgresql
Reloads a service:
# sv h ssh
Shows status of a service and it's log service:
# sv s ssh
Stops a service, and disables it (won't start next boot):
# rm /service/ssh
Refer to man sv for more details.
Shut down the system
# runit-init 0
Reboot the system
# runit-init 6
chmod 700 /etc/sv/myservice/run
sv - used for controlling services, getting status of services, and dependency checking.
chpst - control of a process environment, including memory caps, limits on cores, data segments, environments, user/group privileges, and more.
runsv - supervises a process, and optionally a log service for that process.
svlogd - a simple but powerful logger, includes auto-rotation based on different methods (time, size, etc), post-processing, pattern matching, and socket (remote logging) options. Say goodbye to logrotate and the need to stop your services to rotate logs.
runsvchdir - changes service levels (runlevels, see below).
runsvdir - starts a supervision tree
runit-init - PID 1, tiny, does almost nothing, dietlibc staticly compiled. Just what you want your PID 1 to be.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment