diff options
Diffstat (limited to 'abs/core')
-rwxr-xr-x | abs/core/runit-scripts/PKGBUILD | 2 | ||||
-rwxr-xr-x | abs/core/runit-scripts/runitscripts/services/fah/finish | 16 | ||||
-rw-r--r-- | abs/core/runit-scripts/runitscripts/services/fah/run | 27 |
3 files changed, 44 insertions, 1 deletions
diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD index 47ffd97..970f927 100755 --- a/abs/core/runit-scripts/PKGBUILD +++ b/abs/core/runit-scripts/PKGBUILD @@ -1,6 +1,6 @@ pkgname=runit-scripts pkgver=2.1.1 -pkgrel=89 +pkgrel=90 pkgdesc="collection of startup scripts for runit" url="http://smarden.org/runit/" license="BSD" diff --git a/abs/core/runit-scripts/runitscripts/services/fah/finish b/abs/core/runit-scripts/runitscripts/services/fah/finish new file mode 100755 index 0000000..9385e7c --- /dev/null +++ b/abs/core/runit-scripts/runitscripts/services/fah/finish @@ -0,0 +1,16 @@ +#!/bin/bash +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions + + +[ -e /etc/sv/fah/.runtime ] || mkdir -p /etc/sv/fah/.runtime +touch /etc/sv/fah/.runtime/`date +%s` +numfiles=`/usr/bin/file_time_offset.py -s4 -d/etc/sv/fah/.runtime ` +if [ $numfiles -gt 3 ] +then + rm -f /etc/sv/fah/.runtime/* 2>/dev/null + sv stop fah + printhl " folding@home is not able to start, disabling it" +fi + diff --git a/abs/core/runit-scripts/runitscripts/services/fah/run b/abs/core/runit-scripts/runitscripts/services/fah/run new file mode 100644 index 0000000..1a3b8a6 --- /dev/null +++ b/abs/core/runit-scripts/runitscripts/services/fah/run @@ -0,0 +1,27 @@ +#!/bin/sh +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions +configfile=/etc/fah-config.xml +. /etc/systemconfig +FOLDING_DIR=/data/storage/disk0/media/foldingathome/$hostname +mkdir -p $FOLDING_DIR +chown mythtv:mythtv $FOLDING_DIR + +if [ -d $FOLDING_DIR ] +then + cd $FOLDING_DIR + if [ -e $configfile ] + then + stat_runit "Starting folding@home with $configfile" + exec /opt/fah-v7/FAHClient --config $configfile 2>&1 > /dev/null + else + stat_runit "Starting folding@home" + + /opt/fah-v7/FAHClient --run-as mythtv\ + --team=50975\ + --user=${foldingusername}\ + --max-packet-size=${foldingworksize} 2>&1 > /dev/null + + fi +fi
\ No newline at end of file |