summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2014-04-05 22:30:31 (GMT)
committerBritney Fransen <brfransen@gmail.com>2014-04-05 22:30:31 (GMT)
commit9649ae208248fc14b44dde67d6bc7301127d9f4c (patch)
treeb95348b8ebcb96c8978ea8bce39a6fb822d76415 /abs/core/runit-scripts/runitscripts
parentbdefc1e81c89dbb12e7e914a9f1f220ee5ed1714 (diff)
downloadlinhes_pkgbuild-9649ae208248fc14b44dde67d6bc7301127d9f4c.zip
linhes_pkgbuild-9649ae208248fc14b44dde67d6bc7301127d9f4c.tar.gz
linhes_pkgbuild-9649ae208248fc14b44dde67d6bc7301127d9f4c.tar.bz2
runit-scripts: fix frontend respawn by shutting down all services in 3. refs #961
add pause utility from ignite project remove power script stuff as it is done in poweroff-scripts
Diffstat (limited to 'abs/core/runit-scripts/runitscripts')
-rwxr-xr-xabs/core/runit-scripts/runitscripts/129
-rwxr-xr-xabs/core/runit-scripts/runitscripts/316
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/alsa-utils/finish4
-rwxr-xr-xabs/core/runit-scripts/runitscripts/services/alsa-utils/run5
4 files changed, 36 insertions, 18 deletions
diff --git a/abs/core/runit-scripts/runitscripts/1 b/abs/core/runit-scripts/runitscripts/1
index 9463e60..9f92530 100755
--- a/abs/core/runit-scripts/runitscripts/1
+++ b/abs/core/runit-scripts/runitscripts/1
@@ -1,28 +1,33 @@
#!/bin/bash
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
/etc/rc.sysinit
. /etc/rc.conf
. /etc/rc.d/functions
-#no longer needed rc.sysinit takes care of the hostname
-#hostname `cat /etc/hostname`
-/sbin/sysctl -p 2>/dev/null >/dev/null
+
+sysctl -p 2>/dev/null >/dev/null
+
#make sure permissions are right for /etc/systemconfig
chown root:mythtv /etc/systemconfig
chmod 774 /etc/systemconfig
-/usr/bin/setfacl -m u:mythtv:rw- /etc/systemconfig 2>/dev/null >/dev/null
+setfacl -m u:mythtv:rw- /etc/systemconfig 2>/dev/null >/dev/null
-#yes it's needed the 2nd time
/usr/LH/bin/load-modules-mythvantage.sh >/dev/null
rm /etc/dhcpc/dhcpcd*.pid 2>/dev/null
rm -f /service/frontend/.runtime/* 2>/dev/null
rm -f /etc/runit/reboot 2>/dev/null
-/sbin/agetty -8 38400 tty10 linux &
+agetty -8 38400 tty10 linux &
+
stat_busy "Starting network"
-/bin/mkdir -p /var/lock/subsys
+mkdir -p /var/lock/subsys
/etc/net/scripts/network.init start 2>/var/log/network.init.error >/var/log/network.init
stat_done
-/usr/sbin/ethtool -s eth0 wol g 2>/dev/null
-/usr/sbin/ethtool -s eth1 wol g 2>/dev/null
-/usr/sbin/ethtool -s eth2 wol g 2>/dev/null
+
+ethtool -s eth0 wol g 2>/dev/null
+ethtool -s eth1 wol g 2>/dev/null
+ethtool -s eth2 wol g 2>/dev/null
+
#cleanup of log files
if [ -f /etc/cron.daily/log_care ]
then
@@ -39,13 +44,15 @@ then
/etc/runit/1.local
stat_done
fi
+
#some stuff from rc.multi
run_hook multi_start
+
# Load sysctl config files
/usr/lib/systemd/systemd-sysctl
+
# Load additional binary formats
mountpoint -q /proc/sys/fs/binfmt_misc || mount /proc/sys/fs/binfmt_misc &>/dev/null || mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc
/usr/lib/systemd/systemd-binfmt
-bootlogd_stop
rm -f /run/nologin
diff --git a/abs/core/runit-scripts/runitscripts/3 b/abs/core/runit-scripts/runitscripts/3
index 1a4b384..91617e5 100755
--- a/abs/core/runit-scripts/runitscripts/3
+++ b/abs/core/runit-scripts/runitscripts/3
@@ -1,7 +1,16 @@
#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
clear
. /etc/rc.conf
. /etc/rc.d/functions
+
+stat_busy "Waiting for services to stop..."
+sv -w196 force-stop /service/*
+sv exit /service/*
+stat_done
+
for i in `seq 3`
do
echo " " > /dev/tty1
@@ -18,8 +27,9 @@ then
/etc/runit/3.local
stat_done
fi
-/usr/sbin/ethtool -s eth0 wol g 2>/dev/null
-/usr/sbin/ethtool -s eth1 wol g 2>/dev/null
-/usr/sbin/ethtool -s eth2 wol g 2>/dev/null
+
+ethtool -s eth0 wol g 2>/dev/null
+ethtool -s eth1 wol g 2>/dev/null
+ethtool -s eth2 wol g 2>/dev/null
/etc/rc.shutdown
diff --git a/abs/core/runit-scripts/runitscripts/services/alsa-utils/finish b/abs/core/runit-scripts/runitscripts/services/alsa-utils/finish
index d6f3897..84e3f81 100755
--- a/abs/core/runit-scripts/runitscripts/services/alsa-utils/finish
+++ b/abs/core/runit-scripts/runitscripts/services/alsa-utils/finish
@@ -1,3 +1,3 @@
#!/bin/sh
-exec 2>&1
-sv down alsa-utils
+set -e
+exec /usr/bin/alsactl store
diff --git a/abs/core/runit-scripts/runitscripts/services/alsa-utils/run b/abs/core/runit-scripts/runitscripts/services/alsa-utils/run
index 17f5f99..a376059 100755
--- a/abs/core/runit-scripts/runitscripts/services/alsa-utils/run
+++ b/abs/core/runit-scripts/runitscripts/services/alsa-utils/run
@@ -1,3 +1,4 @@
#!/bin/sh
-exec 2>&1
-exec /etc/rc.d/alsa start
+set -e
+/usr/bin/alsactl restore
+exec chpst -b alsa pause