diff options
author | James Meyer <james.meyer@operamail.com> | 2012-12-04 21:43:03 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-12-04 21:43:03 (GMT) |
commit | 251aa67903af196b8cfe6eac0ff04a37a456238d (patch) | |
tree | 9a7ac8b732af6ef404c598be204ec0966b150e47 /abs/core/runit-scripts | |
parent | 8e702ef5d09ff99df8249f0046e7081b6130812a (diff) | |
download | linhes_pkgbuild-251aa67903af196b8cfe6eac0ff04a37a456238d.zip linhes_pkgbuild-251aa67903af196b8cfe6eac0ff04a37a456238d.tar.gz linhes_pkgbuild-251aa67903af196b8cfe6eac0ff04a37a456238d.tar.bz2 |
runit-scripts: move folding_at_home scripts to runitscripts
Configuration of FAH was moved to the run script so it no longer needs or uses config.xml
However if /etc/fah-config.xml is present it will use it and skip using values from /etc/systemconfig
refs #872
Diffstat (limited to 'abs/core/runit-scripts')
-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 |