summary refs log tree commit diff
path: root/services
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-04-25 23:20:32 +0200
committerJuan RP <xtraeme@gmail.com>2014-04-25 23:20:32 +0200
commitb2fec086b9f498102537e0ff936138b2960e4082 (patch)
tree13dd068d53033bf799a502fff1acbf46dfe0743c /services
downloadrunit-void-b2fec086b9f498102537e0ff936138b2960e4082.tar.gz
runit-void-b2fec086b9f498102537e0ff936138b2960e4082.tar.xz
runit-void-b2fec086b9f498102537e0ff936138b2960e4082.zip
Initial import of runit init scripts based on ignite.
I did not use ignite because it needs bash, and I don't really want it.
Diffstat (limited to 'services')
-rwxr-xr-xservices/agetty-generic/finish4
-rwxr-xr-xservices/agetty-generic/run3
l---------services/agetty-tty1/finish1
-rwxr-xr-xservices/agetty-tty1/run3
l---------services/agetty-tty1/supervise1
l---------services/agetty-tty2/finish1
l---------services/agetty-tty2/run1
l---------services/agetty-tty2/supervise1
l---------services/agetty-tty3/finish1
l---------services/agetty-tty3/run1
l---------services/agetty-tty3/supervise1
l---------services/agetty-tty4/finish1
l---------services/agetty-tty4/run1
l---------services/agetty-tty4/supervise1
l---------services/agetty-tty5/finish1
l---------services/agetty-tty5/run1
l---------services/agetty-tty5/supervise1
l---------services/agetty-tty6/finish1
l---------services/agetty-tty6/run1
l---------services/agetty-tty6/supervise1
l---------services/agetty-ttyS0/finish1
-rwxr-xr-xservices/agetty-ttyS0/run3
l---------services/agetty-ttyS0/supervise1
-rwxr-xr-xservices/alsa/finish3
-rwxr-xr-xservices/alsa/run4
l---------services/alsa/supervise1
-rwxr-xr-xservices/avahi-daemon/run4
l---------services/avahi-daemon/supervise1
-rwxr-xr-xservices/dbus/run4
l---------services/dbus/supervise1
-rwxr-xr-xservices/dcron/log/run2
l---------services/dcron/log/supervise1
-rwxr-xr-xservices/dcron/run3
l---------services/dcron/supervise1
-rwxr-xr-xservices/dhcpcd/run3
l---------services/dhcpcd/supervise1
-rwxr-xr-xservices/ntpd/log/run2
l---------services/ntpd/log/supervise1
-rwxr-xr-xservices/ntpd/run3
l---------services/ntpd/supervise1
-rwxr-xr-xservices/rsyslogd/run3
l---------services/rsyslogd/supervise1
-rwxr-xr-xservices/sshd/run5
l---------services/sshd/supervise1
-rwxr-xr-xservices/sulogin/run2
l---------services/sulogin/supervise1
46 files changed, 81 insertions, 0 deletions
diff --git a/services/agetty-generic/finish b/services/agetty-generic/finish
new file mode 100755
index 0000000..dba0186
--- /dev/null
+++ b/services/agetty-generic/finish
@@ -0,0 +1,4 @@
+#!/bin/sh
+service=$(basename $(pwd))
+tty=${service/*-}
+exec utmpset -w $tty
diff --git a/services/agetty-generic/run b/services/agetty-generic/run
new file mode 100755
index 0000000..a3e6d4b
--- /dev/null
+++ b/services/agetty-generic/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 38400 $tty linux
diff --git a/services/agetty-tty1/finish b/services/agetty-tty1/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty1/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty1/run b/services/agetty-tty1/run
new file mode 100755
index 0000000..dfca715
--- /dev/null
+++ b/services/agetty-tty1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 38400 $([ $tty = tty1 ] && echo --noclear) $tty linux
diff --git a/services/agetty-tty1/supervise b/services/agetty-tty1/supervise
new file mode 120000
index 0000000..a23f48f
--- /dev/null
+++ b/services/agetty-tty1/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty1
\ No newline at end of file
diff --git a/services/agetty-tty2/finish b/services/agetty-tty2/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty2/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty2/run b/services/agetty-tty2/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty2/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty2/supervise b/services/agetty-tty2/supervise
new file mode 120000
index 0000000..a3aee31
--- /dev/null
+++ b/services/agetty-tty2/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty2
\ No newline at end of file
diff --git a/services/agetty-tty3/finish b/services/agetty-tty3/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty3/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty3/run b/services/agetty-tty3/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty3/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty3/supervise b/services/agetty-tty3/supervise
new file mode 120000
index 0000000..06d8483
--- /dev/null
+++ b/services/agetty-tty3/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty3
\ No newline at end of file
diff --git a/services/agetty-tty4/finish b/services/agetty-tty4/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty4/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty4/run b/services/agetty-tty4/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty4/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty4/supervise b/services/agetty-tty4/supervise
new file mode 120000
index 0000000..1e70774
--- /dev/null
+++ b/services/agetty-tty4/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty4
\ No newline at end of file
diff --git a/services/agetty-tty5/finish b/services/agetty-tty5/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty5/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty5/run b/services/agetty-tty5/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty5/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty5/supervise b/services/agetty-tty5/supervise
new file mode 120000
index 0000000..a48f96b
--- /dev/null
+++ b/services/agetty-tty5/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty5
\ No newline at end of file
diff --git a/services/agetty-tty6/finish b/services/agetty-tty6/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty6/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty6/run b/services/agetty-tty6/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty6/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty6/supervise b/services/agetty-tty6/supervise
new file mode 120000
index 0000000..e9243a6
--- /dev/null
+++ b/services/agetty-tty6/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty6
\ No newline at end of file
diff --git a/services/agetty-ttyS0/finish b/services/agetty-ttyS0/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-ttyS0/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-ttyS0/run b/services/agetty-ttyS0/run
new file mode 100755
index 0000000..0f60e37
--- /dev/null
+++ b/services/agetty-ttyS0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 9600 --noclear $tty linux
diff --git a/services/agetty-ttyS0/supervise b/services/agetty-ttyS0/supervise
new file mode 120000
index 0000000..cd9e77f
--- /dev/null
+++ b/services/agetty-ttyS0/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-ttyS0
\ No newline at end of file
diff --git a/services/alsa/finish b/services/alsa/finish
new file mode 100755
index 0000000..84e3f81
--- /dev/null
+++ b/services/alsa/finish
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+exec /usr/bin/alsactl store
diff --git a/services/alsa/run b/services/alsa/run
new file mode 100755
index 0000000..a376059
--- /dev/null
+++ b/services/alsa/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+/usr/bin/alsactl restore
+exec chpst -b alsa pause
diff --git a/services/alsa/supervise b/services/alsa/supervise
new file mode 120000
index 0000000..30bed6b
--- /dev/null
+++ b/services/alsa/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.alsa
\ No newline at end of file
diff --git a/services/avahi-daemon/run b/services/avahi-daemon/run
new file mode 100755
index 0000000..ba08e8e
--- /dev/null
+++ b/services/avahi-daemon/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+echo "Starting avahi..."
+exec avahi-daemon -s
diff --git a/services/avahi-daemon/supervise b/services/avahi-daemon/supervise
new file mode 120000
index 0000000..9cd189b
--- /dev/null
+++ b/services/avahi-daemon/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.avahi-daemon
\ No newline at end of file
diff --git a/services/dbus/run b/services/dbus/run
new file mode 100755
index 0000000..14da8d2
--- /dev/null
+++ b/services/dbus/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+[ ! -d /run/dbus ] && install -m755 -g 22 -o 22 -d /run/dbus
+echo "Starting dbus..."
+exec dbus-daemon --system --nofork
diff --git a/services/dbus/supervise b/services/dbus/supervise
new file mode 120000
index 0000000..f086e0e
--- /dev/null
+++ b/services/dbus/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dbus
\ No newline at end of file
diff --git a/services/dcron/log/run b/services/dcron/log/run
new file mode 100755
index 0000000..b36c4da
--- /dev/null
+++ b/services/dcron/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice
diff --git a/services/dcron/log/supervise b/services/dcron/log/supervise
new file mode 120000
index 0000000..555fc30
--- /dev/null
+++ b/services/dcron/log/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dcron-log
\ No newline at end of file
diff --git a/services/dcron/run b/services/dcron/run
new file mode 100755
index 0000000..bd889e7
--- /dev/null
+++ b/services/dcron/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting dcron..."
+exec crond -f 2>&1
diff --git a/services/dcron/supervise b/services/dcron/supervise
new file mode 120000
index 0000000..99d3e2a
--- /dev/null
+++ b/services/dcron/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dcron
\ No newline at end of file
diff --git a/services/dhcpcd/run b/services/dhcpcd/run
new file mode 100755
index 0000000..3949484
--- /dev/null
+++ b/services/dhcpcd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting dhcpcd..."
+exec /usr/sbin/dhcpcd -q -B 2>&1
diff --git a/services/dhcpcd/supervise b/services/dhcpcd/supervise
new file mode 120000
index 0000000..4fe4a00
--- /dev/null
+++ b/services/dhcpcd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dhcpcd
\ No newline at end of file
diff --git a/services/ntpd/log/run b/services/ntpd/log/run
new file mode 100755
index 0000000..b36c4da
--- /dev/null
+++ b/services/ntpd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice
diff --git a/services/ntpd/log/supervise b/services/ntpd/log/supervise
new file mode 120000
index 0000000..7071288
--- /dev/null
+++ b/services/ntpd/log/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.ntpd-log
\ No newline at end of file
diff --git a/services/ntpd/run b/services/ntpd/run
new file mode 100755
index 0000000..35044d5
--- /dev/null
+++ b/services/ntpd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting ntpd..."
+exec ntpd -g -u ntpd:ntpd -n
diff --git a/services/ntpd/supervise b/services/ntpd/supervise
new file mode 120000
index 0000000..77d9d0d
--- /dev/null
+++ b/services/ntpd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.ntpd
\ No newline at end of file
diff --git a/services/rsyslogd/run b/services/rsyslogd/run
new file mode 100755
index 0000000..9ae41ef
--- /dev/null
+++ b/services/rsyslogd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting rsyslogd..."
+exec rsyslogd -n
diff --git a/services/rsyslogd/supervise b/services/rsyslogd/supervise
new file mode 120000
index 0000000..1bba91f
--- /dev/null
+++ b/services/rsyslogd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.rsyslogd
\ No newline at end of file
diff --git a/services/sshd/run b/services/sshd/run
new file mode 100755
index 0000000..06f36ea
--- /dev/null
+++ b/services/sshd/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "Starting sshd..."
+/usr/bin/ssh-keygen -A # Will generate host keys if they don't already exist
+exec /usr/sbin/sshd -D
diff --git a/services/sshd/supervise b/services/sshd/supervise
new file mode 120000
index 0000000..1ea2704
--- /dev/null
+++ b/services/sshd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.sshd
\ No newline at end of file
diff --git a/services/sulogin/run b/services/sulogin/run
new file mode 100755
index 0000000..f9db040
--- /dev/null
+++ b/services/sulogin/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec setsid /sbin/sulogin -p </dev/tty1 >/dev/tty1 2>&1
diff --git a/services/sulogin/supervise b/services/sulogin/supervise
new file mode 120000
index 0000000..5f3d912
--- /dev/null
+++ b/services/sulogin/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.sulogin
\ No newline at end of file