From b2fec086b9f498102537e0ff936138b2960e4082 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 25 Apr 2014 23:20:32 +0200 Subject: 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. --- services/agetty-generic/finish | 4 ++++ services/agetty-generic/run | 3 +++ services/agetty-tty1/finish | 1 + services/agetty-tty1/run | 3 +++ services/agetty-tty1/supervise | 1 + services/agetty-tty2/finish | 1 + services/agetty-tty2/run | 1 + services/agetty-tty2/supervise | 1 + services/agetty-tty3/finish | 1 + services/agetty-tty3/run | 1 + services/agetty-tty3/supervise | 1 + services/agetty-tty4/finish | 1 + services/agetty-tty4/run | 1 + services/agetty-tty4/supervise | 1 + services/agetty-tty5/finish | 1 + services/agetty-tty5/run | 1 + services/agetty-tty5/supervise | 1 + services/agetty-tty6/finish | 1 + services/agetty-tty6/run | 1 + services/agetty-tty6/supervise | 1 + services/agetty-ttyS0/finish | 1 + services/agetty-ttyS0/run | 3 +++ services/agetty-ttyS0/supervise | 1 + services/alsa/finish | 3 +++ services/alsa/run | 4 ++++ services/alsa/supervise | 1 + services/avahi-daemon/run | 4 ++++ services/avahi-daemon/supervise | 1 + services/dbus/run | 4 ++++ services/dbus/supervise | 1 + services/dcron/log/run | 2 ++ services/dcron/log/supervise | 1 + services/dcron/run | 3 +++ services/dcron/supervise | 1 + services/dhcpcd/run | 3 +++ services/dhcpcd/supervise | 1 + services/ntpd/log/run | 2 ++ services/ntpd/log/supervise | 1 + services/ntpd/run | 3 +++ services/ntpd/supervise | 1 + services/rsyslogd/run | 3 +++ services/rsyslogd/supervise | 1 + services/sshd/run | 5 +++++ services/sshd/supervise | 1 + services/sulogin/run | 2 ++ services/sulogin/supervise | 1 + 46 files changed, 81 insertions(+) create mode 100755 services/agetty-generic/finish create mode 100755 services/agetty-generic/run create mode 120000 services/agetty-tty1/finish create mode 100755 services/agetty-tty1/run create mode 120000 services/agetty-tty1/supervise create mode 120000 services/agetty-tty2/finish create mode 120000 services/agetty-tty2/run create mode 120000 services/agetty-tty2/supervise create mode 120000 services/agetty-tty3/finish create mode 120000 services/agetty-tty3/run create mode 120000 services/agetty-tty3/supervise create mode 120000 services/agetty-tty4/finish create mode 120000 services/agetty-tty4/run create mode 120000 services/agetty-tty4/supervise create mode 120000 services/agetty-tty5/finish create mode 120000 services/agetty-tty5/run create mode 120000 services/agetty-tty5/supervise create mode 120000 services/agetty-tty6/finish create mode 120000 services/agetty-tty6/run create mode 120000 services/agetty-tty6/supervise create mode 120000 services/agetty-ttyS0/finish create mode 100755 services/agetty-ttyS0/run create mode 120000 services/agetty-ttyS0/supervise create mode 100755 services/alsa/finish create mode 100755 services/alsa/run create mode 120000 services/alsa/supervise create mode 100755 services/avahi-daemon/run create mode 120000 services/avahi-daemon/supervise create mode 100755 services/dbus/run create mode 120000 services/dbus/supervise create mode 100755 services/dcron/log/run create mode 120000 services/dcron/log/supervise create mode 100755 services/dcron/run create mode 120000 services/dcron/supervise create mode 100755 services/dhcpcd/run create mode 120000 services/dhcpcd/supervise create mode 100755 services/ntpd/log/run create mode 120000 services/ntpd/log/supervise create mode 100755 services/ntpd/run create mode 120000 services/ntpd/supervise create mode 100755 services/rsyslogd/run create mode 120000 services/rsyslogd/supervise create mode 100755 services/sshd/run create mode 120000 services/sshd/supervise create mode 100755 services/sulogin/run create mode 120000 services/sulogin/supervise (limited to 'services') 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 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 -- cgit 1.4.1