diff options
author | James Meyer <James.meyer@operamail.com> | 2008-10-02 03:19:12 (GMT) |
---|---|---|
committer | James Meyer <James.meyer@operamail.com> | 2008-10-02 03:19:12 (GMT) |
commit | 0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch) | |
tree | c0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core/runit | |
download | linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2 |
initial import
Diffstat (limited to 'abs/core/runit')
56 files changed, 611 insertions, 0 deletions
diff --git a/abs/core/runit/PKGBUILD b/abs/core/runit/PKGBUILD new file mode 100755 index 0000000..4065ae6 --- /dev/null +++ b/abs/core/runit/PKGBUILD @@ -0,0 +1,69 @@ +pkgname=runit +pkgver=1.8.0 +pkgrel=51 +pkgdesc="A replacement for sysvinit, and other init schemes, with service supervision" +url="http://smarden.org/runit/" +license="BSD" +depends=('glibc' 'util-linux' 'initscripts' ) +makedepends=() +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) +arch=('i686') + +build() { + cd $startdir/src/admin/$pkgname-$pkgver/src + echo "${CC:-gcc} ${CFLAGS:--Os}" > conf-cc + echo "${LD:-gcc -s}" > conf-ld + make || return 1 + ./compile svwaitdown.c + ./load svwaitdown unix.a byte.a time.a + ./compile svwaitup.c + ./load svwaitup unix.a byte.a time.a + ./compile utmpset.c + ./load utmpset unix.a byte.a + + + + + install -d $startdir/pkg/sbin/ + install -d $startdir/pkg/usr/man/man8 + install -m0755 $startdir/src/add_service.sh $startdir/pkg/sbin + 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 + + 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 + + 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 -m0755 reboot-runit halt-runit logger $startdir/pkg/sbin + + 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/add_service.sh b/abs/core/runit/add_service.sh new file mode 100755 index 0000000..237af13 --- /dev/null +++ b/abs/core/runit/add_service.sh @@ -0,0 +1,15 @@ +#!/bin/bash +SERVICE_DIR=/var/service +SCRIPT_DIR=/etc/sv +if [ -d $SCRIPT_DIR/$1 ] +then + if [ -d $SERVICE_DIR/$1 ] + then + echo "$1 is already present" + else + ln -s $SCRIPT_DIR/$1 $SERVICE_DIR/$1 + echo "adding $1" + fi +else + echo "couldn't find $SCRIPT_DIR/$1" +fi diff --git a/abs/core/runit/halt.script b/abs/core/runit/halt.script new file mode 100755 index 0000000..b49ed7c --- /dev/null +++ b/abs/core/runit/halt.script @@ -0,0 +1,16 @@ +#!/bin/bash +. /etc/profile +INIT=`ps -p 1 -o comm=` +if [ x$1 = x-w ] +then + /sbin/halt-init -w + exit 0 +fi +chvt 1 +if [ x$INIT = xrunit ] +then + /sbin/halt-runit $@ +else + /sbin/halt-init $@ +fi + diff --git a/abs/core/runit/poweroff.script b/abs/core/runit/poweroff.script new file mode 100755 index 0000000..99779eb --- /dev/null +++ b/abs/core/runit/poweroff.script @@ -0,0 +1,11 @@ +#!/bin/bash +. /etc/profile +INIT=`ps -p 1 -o comm=` +chvt 1 +if [ x$INIT = xrunit ] +then + /sbin/halt-runit $@ +else + /sbin/poweroff.init $@ +fi + diff --git a/abs/core/runit/reboot.script b/abs/core/runit/reboot.script new file mode 100755 index 0000000..fcce679 --- /dev/null +++ b/abs/core/runit/reboot.script @@ -0,0 +1,11 @@ +#!/bin/bash +. /etc/profile +INIT=`ps -p 1 -o comm=` +chvt 1 +if [ x$INIT = xrunit ] +then + /sbin/reboot-runit $@ +else + /sbin/reboot.init $@ +fi + diff --git a/abs/core/runit/remove_service.sh b/abs/core/runit/remove_service.sh new file mode 100755 index 0000000..16c7ecf --- /dev/null +++ b/abs/core/runit/remove_service.sh @@ -0,0 +1,8 @@ +#!/bin/bash +SERVICE_DIR=/var/service +SCRIPT_DIR=/etc/sv +if [ -e $SERVICE_DIR/$1 ] +then + rm $SERVICE_DIR/$1 + echo "removing $1" +fi diff --git a/abs/core/runit/runit.install b/abs/core/runit/runit.install new file mode 100755 index 0000000..4652368 --- /dev/null +++ b/abs/core/runit/runit.install @@ -0,0 +1,57 @@ +# arg 1: the new package version + +pre_install () { +if [ ! -f /sbin/halt-init ] +then + mv /sbin/halt /sbin/halt-init + rm -f /sbin/reboot + rm -f /sbin/poweroff +fi + +} + +pre_upgrade () { +if [ ! -f /sbin/halt-init ] +then + mv /sbin/halt /sbin/halt-init + 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 + + +} + +# 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 + +} + +op=$1 +shift + +$op $* diff --git a/abs/core/runit/runitscripts/1 b/abs/core/runit/runitscripts/1 new file mode 100755 index 0000000..748930f --- /dev/null +++ b/abs/core/runit/runitscripts/1 @@ -0,0 +1,14 @@ +#!/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 new file mode 100755 index 0000000..079b644 --- /dev/null +++ b/abs/core/runit/runitscripts/2 @@ -0,0 +1,8 @@ +#!/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 new file mode 100755 index 0000000..0fa3abc --- /dev/null +++ b/abs/core/runit/runitscripts/3 @@ -0,0 +1,4 @@ +#!/bin/sh +# +export PREVLEVEL=3 +/etc/rc.shutdown diff --git a/abs/core/runit/runitscripts/ctrlaltdel b/abs/core/runit/runitscripts/ctrlaltdel new file mode 100755 index 0000000..2550d3c --- /dev/null +++ b/abs/core/runit/runitscripts/ctrlaltdel @@ -0,0 +1,9 @@ +#!/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 new file mode 100755 index 0000000..7c07b05 --- /dev/null +++ b/abs/core/runit/runitscripts/halt-runit @@ -0,0 +1,2 @@ +#!/bin/sh +runit-init 0 diff --git a/abs/core/runit/runitscripts/logger b/abs/core/runit/runitscripts/logger new file mode 100755 index 0000000..6888f6f --- /dev/null +++ b/abs/core/runit/runitscripts/logger @@ -0,0 +1,11 @@ +#!/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 new file mode 100755 index 0000000..be831ec --- /dev/null +++ b/abs/core/runit/runitscripts/reboot-runit @@ -0,0 +1,2 @@ +#!/bin/sh +runit-init 6 diff --git a/abs/core/runit/runitscripts/services/Xvfb/finish b/abs/core/runit/runitscripts/services/Xvfb/finish new file mode 100755 index 0000000..14cd831 --- /dev/null +++ b/abs/core/runit/runitscripts/services/Xvfb/finish @@ -0,0 +1,12 @@ +#!/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 new file mode 100755 index 0000000..823916d --- /dev/null +++ b/abs/core/runit/runitscripts/services/Xvfb/run @@ -0,0 +1,5 @@ +#!/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 new file mode 100755 index 0000000..daf9859 --- /dev/null +++ b/abs/core/runit/runitscripts/services/acpid/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..d6f3897 --- /dev/null +++ b/abs/core/runit/runitscripts/services/alsa-utils/finish @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..17f5f99 --- /dev/null +++ b/abs/core/runit/runitscripts/services/alsa-utils/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..130d870 --- /dev/null +++ b/abs/core/runit/runitscripts/services/apache/run @@ -0,0 +1,2 @@ +#!/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 new file mode 100755 index 0000000..323d242 --- /dev/null +++ b/abs/core/runit/runitscripts/services/avahi/run @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..99dc014 --- /dev/null +++ b/abs/core/runit/runitscripts/services/cron/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..872ca77 --- /dev/null +++ b/abs/core/runit/runitscripts/services/dbus/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..451dda4 --- /dev/null +++ b/abs/core/runit/runitscripts/services/dnsmasq/run @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..0dd33de --- /dev/null +++ b/abs/core/runit/runitscripts/services/evrouter/finish @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..1d7389a --- /dev/null +++ b/abs/core/runit/runitscripts/services/evrouter/run @@ -0,0 +1,5 @@ +#!/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 new file mode 100755 index 0000000..e1e3e00 --- /dev/null +++ b/abs/core/runit/runitscripts/services/frontend/finish @@ -0,0 +1,30 @@ +#!/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 new file mode 100755 index 0000000..463045f --- /dev/null +++ b/abs/core/runit/runitscripts/services/frontend/log/run @@ -0,0 +1,5 @@ +#!/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 new file mode 100755 index 0000000..b59fc63 --- /dev/null +++ b/abs/core/runit/runitscripts/services/frontend/run @@ -0,0 +1,10 @@ +#!/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 new file mode 100755 index 0000000..361fc43 --- /dev/null +++ b/abs/core/runit/runitscripts/services/gpm/run @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..f1362b2 --- /dev/null +++ b/abs/core/runit/runitscripts/services/hal/run @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..e45173d --- /dev/null +++ b/abs/core/runit/runitscripts/services/hobbit-client/run @@ -0,0 +1,68 @@ +#!/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 new file mode 100755 index 0000000..24ad9fe --- /dev/null +++ b/abs/core/runit/runitscripts/services/hobbit/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..df71bf8 --- /dev/null +++ b/abs/core/runit/runitscripts/services/lcdd/run @@ -0,0 +1,9 @@ +#!/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 new file mode 100755 index 0000000..70cb0a5 --- /dev/null +++ b/abs/core/runit/runitscripts/services/lighttpd/run @@ -0,0 +1,2 @@ +#!/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 new file mode 100755 index 0000000..3545b07 --- /dev/null +++ b/abs/core/runit/runitscripts/services/lircd/finish @@ -0,0 +1,12 @@ +#!/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 new file mode 100755 index 0000000..4457b37 --- /dev/null +++ b/abs/core/runit/runitscripts/services/lircd/run @@ -0,0 +1,39 @@ +#!/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 new file mode 100755 index 0000000..569230e --- /dev/null +++ b/abs/core/runit/runitscripts/services/mysql/run @@ -0,0 +1,29 @@ +#!/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 new file mode 100755 index 0000000..6ed5184 --- /dev/null +++ b/abs/core/runit/runitscripts/services/mythbackend/log/run @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..b33e2e4 --- /dev/null +++ b/abs/core/runit/runitscripts/services/mythbackend/run @@ -0,0 +1,25 @@ +#!/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 new file mode 100755 index 0000000..8a90707 --- /dev/null +++ b/abs/core/runit/runitscripts/services/ncid/run @@ -0,0 +1,5 @@ +#!/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 new file mode 100755 index 0000000..6b032db --- /dev/null +++ b/abs/core/runit/runitscripts/services/ncidd/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..43be94c --- /dev/null +++ b/abs/core/runit/runitscripts/services/netfs/finish @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..f2c0813 --- /dev/null +++ b/abs/core/runit/runitscripts/services/netfs/run @@ -0,0 +1,5 @@ +#!/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 new file mode 100755 index 0000000..6610fe9 --- /dev/null +++ b/abs/core/runit/runitscripts/services/nfsd/run @@ -0,0 +1,22 @@ +#!/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 new file mode 100755 index 0000000..0ec6f75 --- /dev/null +++ b/abs/core/runit/runitscripts/services/nfslock/run @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..9aa27ec --- /dev/null +++ b/abs/core/runit/runitscripts/services/nmbd/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..97302f1 --- /dev/null +++ b/abs/core/runit/runitscripts/services/ntpd/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..f929f39 --- /dev/null +++ b/abs/core/runit/runitscripts/services/oss/finish @@ -0,0 +1,4 @@ +#!/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 new file mode 100755 index 0000000..687de8f --- /dev/null +++ b/abs/core/runit/runitscripts/services/oss/run @@ -0,0 +1,6 @@ +#!/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 new file mode 100755 index 0000000..561d65b --- /dev/null +++ b/abs/core/runit/runitscripts/services/portmap/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..af77dcb --- /dev/null +++ b/abs/core/runit/runitscripts/services/smbd/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..0dd16ef --- /dev/null +++ b/abs/core/runit/runitscripts/services/sshd/run @@ -0,0 +1,8 @@ +#!/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 new file mode 100755 index 0000000..eb56ace --- /dev/null +++ b/abs/core/runit/runitscripts/services/syslog-ng/run @@ -0,0 +1,3 @@ +#!/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 new file mode 100755 index 0000000..3782aed --- /dev/null +++ b/abs/core/runit/runitscripts/services/tty2/run @@ -0,0 +1,2 @@ +#!/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 new file mode 100755 index 0000000..ce66b0d --- /dev/null +++ b/abs/core/runit/runitscripts/services/tty3/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec /sbin/agetty 38400 vc/3 linux |