summaryrefslogtreecommitdiffstats
path: root/abs/core/runit
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/runit')
-rwxr-xr-xabs/core/runit/PKGBUILD27
-rwxr-xr-xabs/core/runit/runit.install40
-rwxr-xr-xabs/core/runit/runitscripts/114
-rwxr-xr-xabs/core/runit/runitscripts/28
-rwxr-xr-xabs/core/runit/runitscripts/34
-rwxr-xr-xabs/core/runit/runitscripts/ctrlaltdel9
-rwxr-xr-xabs/core/runit/runitscripts/halt-runit2
-rwxr-xr-xabs/core/runit/runitscripts/logger11
-rwxr-xr-xabs/core/runit/runitscripts/reboot-runit2
-rwxr-xr-xabs/core/runit/runitscripts/services/Xvfb/finish12
-rwxr-xr-xabs/core/runit/runitscripts/services/Xvfb/run5
-rwxr-xr-xabs/core/runit/runitscripts/services/acpid/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/alsa-utils/finish3
-rwxr-xr-xabs/core/runit/runitscripts/services/alsa-utils/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/apache/run2
-rwxr-xr-xabs/core/runit/runitscripts/services/avahi/run4
-rwxr-xr-xabs/core/runit/runitscripts/services/cron/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/dbus/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/dnsmasq/run4
-rwxr-xr-xabs/core/runit/runitscripts/services/evrouter/finish4
-rwxr-xr-xabs/core/runit/runitscripts/services/evrouter/run5
-rwxr-xr-xabs/core/runit/runitscripts/services/frontend/finish30
-rwxr-xr-xabs/core/runit/runitscripts/services/frontend/log/run5
-rwxr-xr-xabs/core/runit/runitscripts/services/frontend/run10
-rwxr-xr-xabs/core/runit/runitscripts/services/gpm/run4
-rwxr-xr-xabs/core/runit/runitscripts/services/hal/run4
-rwxr-xr-xabs/core/runit/runitscripts/services/hobbit-client/run68
-rwxr-xr-xabs/core/runit/runitscripts/services/hobbit/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/lcdd/run9
-rwxr-xr-xabs/core/runit/runitscripts/services/lighttpd/run2
-rwxr-xr-xabs/core/runit/runitscripts/services/lircd/finish12
-rwxr-xr-xabs/core/runit/runitscripts/services/lircd/run39
-rwxr-xr-xabs/core/runit/runitscripts/services/mysql/run29
-rwxr-xr-xabs/core/runit/runitscripts/services/mythbackend/log/run4
-rwxr-xr-xabs/core/runit/runitscripts/services/mythbackend/run25
-rwxr-xr-xabs/core/runit/runitscripts/services/ncid/run5
-rwxr-xr-xabs/core/runit/runitscripts/services/ncidd/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/netfs/finish3
-rwxr-xr-xabs/core/runit/runitscripts/services/netfs/run5
-rwxr-xr-xabs/core/runit/runitscripts/services/nfsd/run22
-rwxr-xr-xabs/core/runit/runitscripts/services/nfslock/run4
-rwxr-xr-xabs/core/runit/runitscripts/services/nmbd/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/ntpd/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/oss/finish4
-rwxr-xr-xabs/core/runit/runitscripts/services/oss/run6
-rwxr-xr-xabs/core/runit/runitscripts/services/portmap/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/smbd/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/sshd/run8
-rwxr-xr-xabs/core/runit/runitscripts/services/syslog-ng/run3
-rwxr-xr-xabs/core/runit/runitscripts/services/tty2/run2
-rwxr-xr-xabs/core/runit/runitscripts/services/tty3/run2
-rwxr-xr-xabs/core/runit/shutdown.script46
52 files changed, 74 insertions, 463 deletions
diff --git a/abs/core/runit/PKGBUILD b/abs/core/runit/PKGBUILD
index 4065ae6..90bb57e2 100755
--- a/abs/core/runit/PKGBUILD
+++ b/abs/core/runit/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=runit
pkgver=1.8.0
-pkgrel=51
+pkgrel=62
pkgdesc="A replacement for sysvinit, and other init schemes, with service supervision"
url="http://smarden.org/runit/"
license="BSD"
@@ -10,7 +10,7 @@ conflicts=()
replaces=()
backup=()
install=runit.install
-source=(http://smarden.org/runit/$pkgname-$pkgver.tar.gz add_service.sh remove_service.sh halt.script reboot.script poweroff.script)
+source=(http://smarden.org/runit/$pkgname-$pkgver.tar.gz add_service.sh remove_service.sh halt.script reboot.script poweroff.script shutdown.script)
arch=('i686')
build() {
@@ -34,36 +34,33 @@ build() {
install -m0755 $startdir/src/remove_service.sh $startdir/pkg/sbin
install -m0755 $startdir/src/reboot.script $startdir/pkg/sbin
install -m0755 $startdir/src/halt.script $startdir/pkg/sbin
-install -m0755 $startdir/src/poweroff.script $startdir/pkg/sbin
+ install -m0755 $startdir/src/poweroff.script $startdir/pkg/sbin
+ install -m0755 $startdir/src/shutdown.script $startdir/pkg/sbin
for i in `cat ../package/commands`; do
install -m0755 $i $startdir/pkg/sbin/
done
+
install -m0755 svwaitup $startdir/pkg/sbin/
install -m0755 svwaitdown $startdir/pkg/sbin/
install -m0644 ../man/*.8 $startdir/pkg/usr/man/man8
- rsync -a --exclude=.svn $startdir/runitscripts $startdir/src
- #cp -rp $startdir/runitscripts $startdir/src/
- cd $startdir/src/runitscripts
+# rsync -a --exclude=.svn $startdir/runitscripts $startdir/src
+# cd $startdir/src/runitscripts
install -d $startdir/pkg/etc/
install -d $startdir/pkg/etc/runit/
install -d $startdir/pkg/var/service
- #install -d $startdir/pkg/etc/runit/runsvdir
- #install -d $startdir/pkg/etc/runit/runsvdir/default
- #ln -s default $startdir/pkg/etc/runit/runsvdir/current
- install -m0700 1 2 3 ctrlaltdel $startdir/pkg/etc/runit
+# install -m0700 1 2 3 ctrlaltdel $startdir/pkg/etc/runit
+# install -m0755 reboot-runit halt-runit logger $startdir/pkg/sbin
- install -m0755 reboot-runit halt-runit logger $startdir/pkg/sbin
+ # install -d $startdir/pkg/etc/sv
+ # rsync -a --exclude=.svn services/* $startdir/pkg/etc/sv
- install -d $startdir/pkg/etc/sv
- rsync -a --exclude=.svn services/* $startdir/pkg/etc/sv
- #cp -R services/* $startdir/pkg/etc/sv
cd $startdir
install -d $startdir/pkg/usr/bin
- install -m0755 fbd $startdir/pkg/usr/bin/fbd
+
}
diff --git a/abs/core/runit/runit.install b/abs/core/runit/runit.install
index 4652368..1728bc6 100755
--- a/abs/core/runit/runit.install
+++ b/abs/core/runit/runit.install
@@ -4,9 +4,10 @@ pre_install () {
if [ ! -f /sbin/halt-init ]
then
mv /sbin/halt /sbin/halt-init
+ mv /sbin/shutdown /sbin/shutdown-init
+fi
rm -f /sbin/reboot
rm -f /sbin/poweroff
-fi
}
@@ -14,41 +15,32 @@ pre_upgrade () {
if [ ! -f /sbin/halt-init ]
then
mv /sbin/halt /sbin/halt-init
+fi
+
+if [ ! -f /sbin/shutdown-init ]
+then
+ mv /sbin/shutdown /sbin/shutdown-init
+fi
rm -f /sbin/reboot
rm -f /sbin/poweroff
-fi
}
post_install () {
-
- mkdir /var/service
- ln -s /etc/sv/tty* /var/service
- servicelist="acpid cron frontend lircd ntpd alsa-utils avahi dbus portmap sshd"
- for i in $servicelist
- do
- ln -s /etc/sv/$i /var/service/$i
- done
-
- ln -s /sbin/halt.script /sbin/halt
- ln -s /sbin/reboot.script /sbin/reboot
- ln -s /sbin/poweroff.script /sbin/poweroff
- ln -s /sbin/halt-init /sbin/reboot.init
- ln -s /sbin/halt-init /sbin/poweroff.init
-
-
+ mkdir /var/service
+ [ -e /sbin/halt ] || ln -s /sbin/halt.script /sbin/halt
+ [ -e /sbin/reboot ] || ln -s /sbin/reboot.script /sbin/reboot
+ [ -e /sbin/poweroff ] || ln -s /sbin/poweroff.script /sbin/poweroff
+ [ -e /sbin/reboot.init ] || ln -s /sbin/halt-init /sbin/reboot.init
+ [ -e /sbin/poweroff.init ] || ln -s /sbin/halt-init /sbin/poweroff.init
+ [ -e /sbin/shutdown ] || ln -s /sbin/shutdown.script /sbin/shutdown
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade(){
- ln -s /sbin/halt.script /sbin/halt
- ln -s /sbin/reboot.script /sbin/reboot
- ln -s /sbin/poweroff.script /sbin/poweroff
- ln -s /sbin/halt-init /sbin/reboot.init
- ln -s /sbin/halt-init /sbin/poweroff.init
-
+ /bin/true
}
op=$1
diff --git a/abs/core/runit/runitscripts/1 b/abs/core/runit/runitscripts/1
deleted file mode 100755
index 748930f..0000000
--- a/abs/core/runit/runitscripts/1
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-/etc/rc.sysinit
-hostname `cat /etc/hostname`
-/sbin/sysctl -p 2>/dev/null >/dev/null
-#/usr/bin/load-modules-mythvantage.sh
-rm /etc/dhcpc/dhcpcd*.pid 2>/dev/null
-rm -f /etc/sv/frontend/.runtime/* 2>/dev/null
-rm -f /etc/runit/reboot 2>/dev/null
-/etc/net/scripts/network.init start 2>/var/log/network.init.error >/var/log/network.init
-/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
-
-#/bin/su mythtv -c /usr/bin/grabkey.py 2>/dev/null 1>/devn/null &
diff --git a/abs/core/runit/runitscripts/2 b/abs/core/runit/runitscripts/2
deleted file mode 100755
index 079b644..0000000
--- a/abs/core/runit/runitscripts/2
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-
-#runsvchdir default >/dev/null
-
-exec env - PATH=$PATH \
-runsvdir -P /var/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
diff --git a/abs/core/runit/runitscripts/3 b/abs/core/runit/runitscripts/3
deleted file mode 100755
index 0fa3abc..0000000
--- a/abs/core/runit/runitscripts/3
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-#
-export PREVLEVEL=3
-/etc/rc.shutdown
diff --git a/abs/core/runit/runitscripts/ctrlaltdel b/abs/core/runit/runitscripts/ctrlaltdel
deleted file mode 100755
index 2550d3c..0000000
--- a/abs/core/runit/runitscripts/ctrlaltdel
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/usr/bin
-MSG="System is going down in 10 seconds..."
-
-# echo 'disabled.' ; exit
-touch /etc/runit/stopit
-chmod 100 /etc/runit/stopit && echo "$MSG" | wall
-/bin/sleep 10
diff --git a/abs/core/runit/runitscripts/halt-runit b/abs/core/runit/runitscripts/halt-runit
deleted file mode 100755
index 7c07b05..0000000
--- a/abs/core/runit/runitscripts/halt-runit
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-runit-init 0
diff --git a/abs/core/runit/runitscripts/logger b/abs/core/runit/runitscripts/logger
deleted file mode 100755
index 6888f6f..0000000
--- a/abs/core/runit/runitscripts/logger
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-svname=$( cd .. && basename $( pwd ) )
-if [ ! -d /var/log/$svname ]
-then
- mkdir /var/log/$svname
- chown root.root /var/log/$svname
- chmod 700 /var/log/$svname
-fi
-
-exec /sbin/svlogd -tt /var/log/$svname
diff --git a/abs/core/runit/runitscripts/reboot-runit b/abs/core/runit/runitscripts/reboot-runit
deleted file mode 100755
index be831ec..0000000
--- a/abs/core/runit/runitscripts/reboot-runit
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-runit-init 6
diff --git a/abs/core/runit/runitscripts/services/Xvfb/finish b/abs/core/runit/runitscripts/services/Xvfb/finish
deleted file mode 100755
index 14cd831..0000000
--- a/abs/core/runit/runitscripts/services/Xvfb/finish
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-. /etc/profile
-VIRTUAL_DISPLAY=":50"
-Xvfb_parm="$VIRTUAL_DISPLAY -screen 0 800x600x16"
-pid=`ps -eaf | grep Xvfb | grep $VIRTUAL_DISPLAY | awk '{print $2}'`
- if [ $pid ]
- then
- kill -9 $pid
-# echo $pid
-fi
-rm -f /tmp/.X${VIRTUAL_DISPLAY}-lock
-
diff --git a/abs/core/runit/runitscripts/services/Xvfb/run b/abs/core/runit/runitscripts/services/Xvfb/run
deleted file mode 100755
index 823916d..0000000
--- a/abs/core/runit/runitscripts/services/Xvfb/run
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-. /etc/profile
-VIRTUAL_DISPLAY=":50"
-Xvfb_parm="$VIRTUAL_DISPLAY -screen 0 800x600x16"
-Xvfb $Xvfb_parm
diff --git a/abs/core/runit/runitscripts/services/acpid/run b/abs/core/runit/runitscripts/services/acpid/run
deleted file mode 100755
index daf9859..0000000
--- a/abs/core/runit/runitscripts/services/acpid/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/sbin/acpid -f -c /etc/acpi/events 2>/dev/null >/dev/null
diff --git a/abs/core/runit/runitscripts/services/alsa-utils/finish b/abs/core/runit/runitscripts/services/alsa-utils/finish
deleted file mode 100755
index d6f3897..0000000
--- a/abs/core/runit/runitscripts/services/alsa-utils/finish
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-sv down alsa-utils
diff --git a/abs/core/runit/runitscripts/services/alsa-utils/run b/abs/core/runit/runitscripts/services/alsa-utils/run
deleted file mode 100755
index 17f5f99..0000000
--- a/abs/core/runit/runitscripts/services/alsa-utils/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /etc/rc.d/alsa start
diff --git a/abs/core/runit/runitscripts/services/apache/run b/abs/core/runit/runitscripts/services/apache/run
deleted file mode 100755
index 130d870..0000000
--- a/abs/core/runit/runitscripts/services/apache/run
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec /usr/local/apache/bin/httpd -DNO_DETACH
diff --git a/abs/core/runit/runitscripts/services/avahi/run b/abs/core/runit/runitscripts/services/avahi/run
deleted file mode 100755
index 323d242..0000000
--- a/abs/core/runit/runitscripts/services/avahi/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/sbin/avahi-daemon >/dev/null 2>/dev/null
-
diff --git a/abs/core/runit/runitscripts/services/cron/run b/abs/core/runit/runitscripts/services/cron/run
deleted file mode 100755
index 99dc014..0000000
--- a/abs/core/runit/runitscripts/services/cron/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/sbin/crond -f >/dev/null 2>/dev/null
diff --git a/abs/core/runit/runitscripts/services/dbus/run b/abs/core/runit/runitscripts/services/dbus/run
deleted file mode 100755
index 872ca77..0000000
--- a/abs/core/runit/runitscripts/services/dbus/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/bin/dbus-daemon --system --nofork 2>/dev/null >/dev/null
diff --git a/abs/core/runit/runitscripts/services/dnsmasq/run b/abs/core/runit/runitscripts/services/dnsmasq/run
deleted file mode 100755
index 451dda4..0000000
--- a/abs/core/runit/runitscripts/services/dnsmasq/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/sbin/dnsmasq -k >/dev/null 2>/dev/null
-
diff --git a/abs/core/runit/runitscripts/services/evrouter/finish b/abs/core/runit/runitscripts/services/evrouter/finish
deleted file mode 100755
index 0dd33de..0000000
--- a/abs/core/runit/runitscripts/services/evrouter/finish
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-. /etc/profile
-DISPLAY=localhost:50 evrouter -q
-rm -rf /tmp/.evrouter*
diff --git a/abs/core/runit/runitscripts/services/evrouter/run b/abs/core/runit/runitscripts/services/evrouter/run
deleted file mode 100755
index 1d7389a..0000000
--- a/abs/core/runit/runitscripts/services/evrouter/run
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-. /etc/profile
-sv start Xvfb
-su mythtv -c "DISPLAY=localhost:50 evrouter -c /etc/evrouter.cfg -f /dev/input/event*"
-
diff --git a/abs/core/runit/runitscripts/services/frontend/finish b/abs/core/runit/runitscripts/services/frontend/finish
deleted file mode 100755
index e1e3e00..0000000
--- a/abs/core/runit/runitscripts/services/frontend/finish
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-exec 2>&1
-grep -q nox /proc/cmdline
-STATUS=$?
- if [ $STATUS = 0 ]
- then
- chvt 2
-else
-
-chvt 1
-if [ ! -d /etc/sv/frontend/.runtime ]
-then
- mkdir -p /etc/sv/frontend/.runtime
-fi
-
-touch /etc/sv/frontend/.runtime/`date +%s`
-sleep 0.2
-ps -U mythtv -ef |grep "/bin/sh /usr/bin/startx"|grep -v grep|awk ' { print $2 } '|xargs kill -9 2> /dev/null
-
-
-cdate=`date`
-numfiles=`/usr/bin/file_time_offset.py -s10 -d/etc/sv/frontend/.runtime`
-
-if [ $numfiles -gt 2 ]
-then
- sv stop frontend
- rm -f /etc/sv/frontend/.runtime/*
- echo "Frontend is not able to start, disabling it"
-fi
-fi
diff --git a/abs/core/runit/runitscripts/services/frontend/log/run b/abs/core/runit/runitscripts/services/frontend/log/run
deleted file mode 100755
index 463045f..0000000
--- a/abs/core/runit/runitscripts/services/frontend/log/run
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-exec 2>&1
-. /etc/systemconfig
- /usr/bin/logger -p local6.info -t mythfrontend
-
diff --git a/abs/core/runit/runitscripts/services/frontend/run b/abs/core/runit/runitscripts/services/frontend/run
deleted file mode 100755
index b59fc63..0000000
--- a/abs/core/runit/runitscripts/services/frontend/run
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-exec 2>&1
- grep -q nox /proc/cmdline
- STATUS=$?
- if [ $STATUS = 0 ]
- then
- sv down frontend
- exit 0
- fi
-/usr/bin/openvt -fwc 6 -- /bin/su - mythtv -c /usr/bin/startx >& /dev/null
diff --git a/abs/core/runit/runitscripts/services/gpm/run b/abs/core/runit/runitscripts/services/gpm/run
deleted file mode 100755
index 361fc43..0000000
--- a/abs/core/runit/runitscripts/services/gpm/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-. /etc/sysconfig/mouse
-exec gpm -D -m $MDEVICE -t $PROTOCOL
diff --git a/abs/core/runit/runitscripts/services/hal/run b/abs/core/runit/runitscripts/services/hal/run
deleted file mode 100755
index f1362b2..0000000
--- a/abs/core/runit/runitscripts/services/hal/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-sv waitup dbus 2>/dev/null 1>/dev/null
-exec /usr/sbin/hald --daemon=no --use-syslog 2>/dev/null >/dev/null
diff --git a/abs/core/runit/runitscripts/services/hobbit-client/run b/abs/core/runit/runitscripts/services/hobbit-client/run
deleted file mode 100755
index e45173d..0000000
--- a/abs/core/runit/runitscripts/services/hobbit-client/run
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/sh
-#----------------------------------------------------------------------------#
-# Hobbit client bootup script. #
-# #
-# This invokes hobbitlaunch, which in turn runs the Hobbit client and any #
-# extensions configured. #
-# #
-# Copyright (C) 2005-2006 Henrik Storner <henrik@hswn.dk> #
-# "status" section (C) Scott Smith 2006 #
-# #
-# This program is released under the GNU General Public License (GPL), #
-# version 2. See the file "COPYING" for details. #
-# #
-#----------------------------------------------------------------------------#
-#
-# $Id: runclient.sh,v 1.13 2006/07/14 21:25:19 henrik Rel $
-
-# Default settings for this client
-MACHINEDOTS="`uname -n`" # This systems hostname
-BBOSTYPE="`uname -s | tr '[A-Z]' '[a-z]'`" # This systems operating system in lowercase
-BBOSSCRIPT="hobbitclient-$BBOSTYPE.sh"
-
-# Commandline mods for the defaults
-while test "$1" != ""
-do
- case "$1" in
- --hostname=*)
- MACHINEDOTS="`echo $1 | sed -e 's/--hostname=//'`"
- ;;
- --os=*)
- BBOSTYPE="`echo $1 | sed -e 's/--os=//' | tr '[A-Z]' '[a-z]'`"
- ;;
- --class=*)
- CONFIGCLASS="`echo $1 | sed -e 's/--class=//' | tr '[A-Z]' '[a-z]'`"
- ;;
- --help)
- echo "Usage: $0 [--hostname=CLIENTNAME] [--os=rhel3|linux22] [--class=CLASSNAME] start|stop"
- exit 0
- ;;
- start)
- CMD=$1
- ;;
- stop)
- CMD=$1
- ;;
- restart)
- CMD=$1
- ;;
- status)
- CMD=$1
- ;;
- esac
-
- shift
-done
-
-OLDDIR="`pwd`"
-cd "`dirname $0`"
-HOBBITCLIENTHOME="/data/srv/hobbit/client"
-cd "$OLDDIR"
-
-MACHINE="`echo $MACHINEDOTS | sed -e 's/\./,/g'`"
-
-export MACHINE MACHINEDOTS BBOSTYPE BBOSSCRIPT HOBBITCLIENTHOME CONFIGCLASS
-
-
-su nobody -c "$HOBBITCLIENTHOME/bin/hobbitlaunch --config=$HOBBITCLIENTHOME/etc/clientlaunch.cfg --log=$HOBBITCLIENTHOME/logs/clientlaunch.log --pidfile=$HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid --no-daemon"
-
diff --git a/abs/core/runit/runitscripts/services/hobbit/run b/abs/core/runit/runitscripts/services/hobbit/run
deleted file mode 100755
index 24ad9fe..0000000
--- a/abs/core/runit/runitscripts/services/hobbit/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec su nobody -c "/data/srv/hobbit/server/bin/hobbitlaunch --config=/data/srv/hobbit/server/etc/hobbitlaunch.cfg --env=/data/srv/hobbit/server/etc/hobbitserver.cfg --log=/var/log/hobbit/hobbitlaunch.log --pidfile=/var/log/hobbit/hobbitlaunch.pid --no-daemon"
diff --git a/abs/core/runit/runitscripts/services/lcdd/run b/abs/core/runit/runitscripts/services/lcdd/run
deleted file mode 100755
index df71bf8..0000000
--- a/abs/core/runit/runitscripts/services/lcdd/run
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-. /etc/systemconfig
-exec 2>&1
-if [ x$LCDtype = xxosd ]
-then
- DISPLAY=127.0.0.1:0 /usr/sbin/LCDd -f -c /etc/LCDd.conf 2>/dev/null >/dev/null
-else
- exec /usr/sbin/LCDd -f -c /etc/LCDd.conf 2>/dev/null >/dev/null
-fi
diff --git a/abs/core/runit/runitscripts/services/lighttpd/run b/abs/core/runit/runitscripts/services/lighttpd/run
deleted file mode 100755
index 70cb0a5..0000000
--- a/abs/core/runit/runitscripts/services/lighttpd/run
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-exec /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
diff --git a/abs/core/runit/runitscripts/services/lircd/finish b/abs/core/runit/runitscripts/services/lircd/finish
deleted file mode 100755
index 3545b07..0000000
--- a/abs/core/runit/runitscripts/services/lircd/finish
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-killall -9 lircd
-rm -f /var/run/lirc*.pid
-touch /etc/sv/lircd/.runtime/`date +%s`
-numfiles=`/usr/bin/file_time_offset.py -s4 -d/etc/sv/lircd/.runtime `
-if [ $numfiles -gt 3 ]
-then
- rm -f /etc/sv/lircd/.runtime/*
- ls -la /etc/sv/lircd/.runtime/*
- sv stop lircd
- echo "lircd is not able to start, disabling it"
-fi
diff --git a/abs/core/runit/runitscripts/services/lircd/run b/abs/core/runit/runitscripts/services/lircd/run
deleted file mode 100755
index 4457b37..0000000
--- a/abs/core/runit/runitscripts/services/lircd/run
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-exec 2>&1
-run_lircd2=false
-. /etc/systemconfig
-function imon_detect {
-if [ -e /dev/lirc_imon ]
-then
-lircd2_cmd="/usr/sbin/lircd -d /dev/lirc_imon --output=/dev/lircd --pidfile=/var/run/lircd2.pid --connect=localhost:8765"
-run_lircd2=true
-fi
-}
-
-
-
-case $ReceiverType in
- Serial)
- /usr/bin/setserial /dev/$ReceiverSerialport uart none
- /sbin/modprobe lirc_serial
- DEVICE=`ls /dev/lirc[0-9] 2>/dev/null |sort |sed '/./,$!d'|head -n 1 `
- imon_detect
- ;;
- Usb-imon)
- DEVICE=/dev/lirc_imon
- ;;
-
- *)
-
- DEVICE=`ls /dev/lirc[0-9] 2>/dev/null |sort |sed '/./,$!d'|head -n 1 `
- imon_detect
- ;;
-esac
-
-if [ "$run_lircd2" = "true" ]
-then
- $lircd2_cmd 2>/dev/null 1>/dev/null
- exec /usr/sbin/lircd -n -d $DEVICE --output /dev/lircd1 --listen 2>/dev/null 1>/dev/null
-else
- exec /usr/sbin/lircd -n -d $DEVICE 2>/dev/null 1>/dev/null
-fi
diff --git a/abs/core/runit/runitscripts/services/mysql/run b/abs/core/runit/runitscripts/services/mysql/run
deleted file mode 100755
index 569230e..0000000
--- a/abs/core/runit/runitscripts/services/mysql/run
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-exec 2>&1
-
-MYSQLD_ROOT="/data/srv/mysql"
-# source application-specific settings
-[ -f /etc/conf.d/mysqld ] && . /etc/conf.d/mysqld
-if [ ! `egrep '^mysql:' /etc/group` ]; then
- stat_busy "Adding mysql group"
- groupadd -g 89 mysql
- stat_done
-fi
-if [ ! `egrep '^mysql:' /etc/passwd` ]; then
- stat_busy "Adding mysql user"
- useradd -u 89 -g mysql -d $MYSQLD_ROOT -s /bin/false mysql
- [ -d $MYSQLD_ROOT ] && chown -R mysql.mysql $MYSQLD_ROOT
- stat_done
-fi
-
-if [ ! -d $MYSQLD_ROOT ]; then
- mkdir $MYSQLD_ROOT
- /usr/bin/mysql_install_db --datadir=$MYSQLD_ROOT --user=mysql
- chown -R mysql.mysql $MYSQLD_ROOT
-fi
-
-if [ ! -e /var/log/mysqld.log ]; then
- touch /var/log/mysqld.log
- chown mysql /var/log/mysqld.log
-fi
-exec /usr/sbin/mysqld -u mysql 2>/dev/null >/dev/null
diff --git a/abs/core/runit/runitscripts/services/mythbackend/log/run b/abs/core/runit/runitscripts/services/mythbackend/log/run
deleted file mode 100755
index 6ed5184..0000000
--- a/abs/core/runit/runitscripts/services/mythbackend/log/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
- /usr/bin/logger -p local7.info -t mythbackend
-
diff --git a/abs/core/runit/runitscripts/services/mythbackend/run b/abs/core/runit/runitscripts/services/mythbackend/run
deleted file mode 100755
index b33e2e4..0000000
--- a/abs/core/runit/runitscripts/services/mythbackend/run
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-exec 2>&1
-. /etc/profile
-. /etc/systemconfig
-export HOME=/root
-if [ ! x$SystemType = xSlave_backend ]
-then
- sv start mysql > /dev/null 2>/dev/null
- #run mythfilldatabase
- /usr/MythVantage/bin/initial_db_run &
-fi
-mkfifo /tmp/mbefifo >/dev/null 2>/dev/null
-echo "Starting mythbackend"
-# if [ -f /tmp/debug ]
-# then
-# echo "using gbd/debug"
-# gdb /usr/bin/mythbackend -x $MV_ROOT/mbegdbcommands.txt
-# bash -c "osdClient.pl localhost 5000 'Restart gdb mbe :::SYS' "&
-# mv gdb.txt /data/home/mythtv/gdb.txt.mythbackend
-# chown mythtv:mythtv /data/home/mythtv/gdb.txt.mythbackend
-# sleep 10
-#
-# else
- exec /usr/bin/mythbackend
-# fi
diff --git a/abs/core/runit/runitscripts/services/ncid/run b/abs/core/runit/runitscripts/services/ncid/run
deleted file mode 100755
index 8a90707..0000000
--- a/abs/core/runit/runitscripts/services/ncid/run
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-exec 2>&1
-sv start ncidd
-exec /usr/bin/ncid --no-gui --all --call-prog --program /usr/bin/ncid.py 127.0.0.1 3333
-
diff --git a/abs/core/runit/runitscripts/services/ncidd/run b/abs/core/runit/runitscripts/services/ncidd/run
deleted file mode 100755
index 6b032db..0000000
--- a/abs/core/runit/runitscripts/services/ncidd/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/sbin/ncidd -D 2>&1
diff --git a/abs/core/runit/runitscripts/services/netfs/finish b/abs/core/runit/runitscripts/services/netfs/finish
deleted file mode 100755
index 43be94c..0000000
--- a/abs/core/runit/runitscripts/services/netfs/finish
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-sv down netfs
diff --git a/abs/core/runit/runitscripts/services/netfs/run b/abs/core/runit/runitscripts/services/netfs/run
deleted file mode 100755
index f2c0813..0000000
--- a/abs/core/runit/runitscripts/services/netfs/run
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-exec 2>&1
-sv start portmap
-/etc/rc.d/netfs start
-
diff --git a/abs/core/runit/runitscripts/services/nfsd/run b/abs/core/runit/runitscripts/services/nfsd/run
deleted file mode 100755
index 6610fe9..0000000
--- a/abs/core/runit/runitscripts/services/nfsd/run
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-exec 2>&1
-
-# Make sure the statd daemon is up
-# (the statd service must ensure portmap is running first)
-svwaitup /var/service/nfslock >/dev/null 2>/dev/null
-
-source /etc/conf.d/nfsd
-
-# Re-export all directories in /etc/exports
-/usr/sbin/exportfs -ra > /dev/null 2>/dev/null
-
-# start some nfsd threads
-/usr/sbin/rpc.nfsd -p ${NFSD_OPTS} >/dev/null 2>/dev/null
-
-# since we are running kernel 2.6 we should also
-# mount the nfsd virtual filesystem
-/bin/mount -t nfsd none /proc/fs/nfsd >/dev/null 2>/dev/null
-
-# Start the rpc.mountd daemon
-exec /usr/sbin/rpc.mountd --foreground >/dev/null 2>/dev/null
-
diff --git a/abs/core/runit/runitscripts/services/nfslock/run b/abs/core/runit/runitscripts/services/nfslock/run
deleted file mode 100755
index 0ec6f75..0000000
--- a/abs/core/runit/runitscripts/services/nfslock/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-exec 2>&1
-sv start portmap >/dev/null 2>/dev/null
-/usr/sbin/rpc.statd -F >/dev/null 2>/dev/null
diff --git a/abs/core/runit/runitscripts/services/nmbd/run b/abs/core/runit/runitscripts/services/nmbd/run
deleted file mode 100755
index 9aa27ec..0000000
--- a/abs/core/runit/runitscripts/services/nmbd/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec nmbd -F -S -d1 2>/dev/null >/dev/null
diff --git a/abs/core/runit/runitscripts/services/ntpd/run b/abs/core/runit/runitscripts/services/ntpd/run
deleted file mode 100755
index 97302f1..0000000
--- a/abs/core/runit/runitscripts/services/ntpd/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-ntpdate pool.ntp.org
-exec ntpd -n -p /var/run/ntpd.pid
diff --git a/abs/core/runit/runitscripts/services/oss/finish b/abs/core/runit/runitscripts/services/oss/finish
deleted file mode 100755
index f929f39..0000000
--- a/abs/core/runit/runitscripts/services/oss/finish
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-exec 2>&1
-sv down oss
-
diff --git a/abs/core/runit/runitscripts/services/oss/run b/abs/core/runit/runitscripts/services/oss/run
deleted file mode 100755
index 687de8f..0000000
--- a/abs/core/runit/runitscripts/services/oss/run
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-exec 2>&1
-rm -f /usr/lib/oss/starting
-#exec /etc/rc.d/alsa-utils start all
-exec /usr/sbin/soundon
-
diff --git a/abs/core/runit/runitscripts/services/portmap/run b/abs/core/runit/runitscripts/services/portmap/run
deleted file mode 100755
index 561d65b..0000000
--- a/abs/core/runit/runitscripts/services/portmap/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /sbin/portmap -d >/dev/null 2>/dev/null
diff --git a/abs/core/runit/runitscripts/services/smbd/run b/abs/core/runit/runitscripts/services/smbd/run
deleted file mode 100755
index af77dcb..0000000
--- a/abs/core/runit/runitscripts/services/smbd/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec smbd -F -S -d3 2>/dev/null >/dev/null
diff --git a/abs/core/runit/runitscripts/services/sshd/run b/abs/core/runit/runitscripts/services/sshd/run
deleted file mode 100755
index 0dd16ef..0000000
--- a/abs/core/runit/runitscripts/services/sshd/run
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-exec 2>&1
-
-[ -f /etc/ssh/ssh_host_key ] || { /usr/bin/ssh-keygen -t rsa1 -N "" -f /etc/ssh/ssh_host_key >/dev/null; }
- [ -f /etc/ssh/ssh_host_rsa_key ] || { /usr/bin/ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key >/dev/null; }
- [ -f /etc/ssh/ssh_host_dsa_key ] || { /usr/bin/ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key >/dev/null; }
-
-exec /usr/sbin/sshd -D >/dev/null 2>/dev/null
diff --git a/abs/core/runit/runitscripts/services/syslog-ng/run b/abs/core/runit/runitscripts/services/syslog-ng/run
deleted file mode 100755
index eb56ace..0000000
--- a/abs/core/runit/runitscripts/services/syslog-ng/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/sbin/syslog-ng -F
diff --git a/abs/core/runit/runitscripts/services/tty2/run b/abs/core/runit/runitscripts/services/tty2/run
deleted file mode 100755
index 3782aed..0000000
--- a/abs/core/runit/runitscripts/services/tty2/run
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec /sbin/agetty 38400 vc/2 linux
diff --git a/abs/core/runit/runitscripts/services/tty3/run b/abs/core/runit/runitscripts/services/tty3/run
deleted file mode 100755
index ce66b0d..0000000
--- a/abs/core/runit/runitscripts/services/tty3/run
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec /sbin/agetty 38400 vc/3 linux
diff --git a/abs/core/runit/shutdown.script b/abs/core/runit/shutdown.script
new file mode 100755
index 0000000..3bcc5d3
--- /dev/null
+++ b/abs/core/runit/shutdown.script
@@ -0,0 +1,46 @@
+#!/bin/bash
+. /etc/profile
+INIT=`ps -p 1 -o comm=`
+if [ x$INIT = xrunit ]
+then
+ reboot=""
+ halt=""
+ delay=""
+ while getopts rht: name
+ do
+ case $name in
+ r) reboot=1 ;;
+ h) halt=1 ;;
+ t) delay="$OPTARG"
+ if [ x$delay = "xnow" ]
+ then
+ delay=0
+ fi
+ ;;
+ *)
+ exit 2;;
+ esac
+ done
+ if [ x$delay = x ]
+ then
+ echo "-t is mandatory"
+ exit 4
+ fi
+
+ if [ x$reboot = x1 ]
+ then
+ wall "System will reboot in $delay seconds"
+ sleep $delay
+ /sbin/runit-init 6
+ fi
+
+ if [ x$halt = x1 ]
+ then
+ wall "System will poweroff in $delay seconds"
+ sleep $delay
+ /sbin/runit-init 0
+ fi
+
+else
+ /sbin/shutdown-init $@
+fi