aboutsummaryrefslogtreecommitdiff
path: root/runit-guide.md
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2016-07-27 16:26:26 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2016-07-27 16:26:26 -0500
commitf62253b8334a85dac4671e42817b96a3bedd1881 (patch)
tree1581d14558c867ca217235aa5cc9c0cf8a801e88 /runit-guide.md
parentf2c2e2dd5a5e0a22da4dcabea6615d0f4697a962 (diff)
Add support for runit
X-Gentoo-Bug: 501364 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=501364
Diffstat (limited to 'runit-guide.md')
-rw-r--r--runit-guide.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/runit-guide.md b/runit-guide.md
new file mode 100644
index 00000000..93a3eecd
--- /dev/null
+++ b/runit-guide.md
@@ -0,0 +1,41 @@
+# Using runit with OpenRC
+
+Beginning with OpenRC-0.21, we support using runit [1] in place of
+start-stop-daemon for monitoring and restarting daemons.
+
+## Setup
+
+Documenting runit in detail is beyond the scope of this guide. It will
+document how to set up OpenRC services to communicate with runit.
+
+### Use Default start, stop and status functions
+
+If you write your own start, stop and status functions in your service
+script, none of this will work. You must allow OpenRC to use the default
+functions.
+
+### Dependencies
+
+All OpenRC service scripts that want their daemons monitored by runit
+should have the following line added to their dependencies to make sure
+the runit scan directory is being monitored.
+
+need runsvdir
+
+### Variable Settings
+
+The most important setting is the supervisor variable. At the top of
+your service script, you should set this variable as follows:
+
+supervisor=runit
+
+The second variable you need is runit_service. This is the path to the
+runit service you wish to control via OpenRC. The default is
+/etc/sv/${RC_SVCNAME}. This means that for an OpenRC service
+/etc/init.d/foo, you will need to create the same runit service in
+/etc/sv/foo.
+
+This is very early support, so feel free to file bugs if you have
+issues.
+
+[1] http://www.smarden.org/runit