diff options
author | James Meyer <james.meyer@operamail.com> | 2008-11-11 19:30:47 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2008-11-11 19:30:47 (GMT) |
commit | 9431f7ae609b0877b403bad9db39aed4df159229 (patch) | |
tree | ff95f8397492cb577d8c725f90cd9503d499d5a5 /abs/core-testing/runit-scripts/runitscripts/services/hobbit-client | |
parent | df5646446d84f38b695f00706a57b4c851be462a (diff) | |
download | linhes_pkgbuild-9431f7ae609b0877b403bad9db39aed4df159229.zip linhes_pkgbuild-9431f7ae609b0877b403bad9db39aed4df159229.tar.gz linhes_pkgbuild-9431f7ae609b0877b403bad9db39aed4df159229.tar.bz2 |
move the runit init scripts into their own package.
Diffstat (limited to 'abs/core-testing/runit-scripts/runitscripts/services/hobbit-client')
-rwxr-xr-x | abs/core-testing/runit-scripts/runitscripts/services/hobbit-client/run | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/abs/core-testing/runit-scripts/runitscripts/services/hobbit-client/run b/abs/core-testing/runit-scripts/runitscripts/services/hobbit-client/run new file mode 100755 index 0000000..e45173d --- /dev/null +++ b/abs/core-testing/runit-scripts/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" + |