Rev 850 | Blame | Last modification | View Log | RSS feed
#!/bin/sh#set -x## buildtool This shell script takes care of starting and stopping# buildtool.## Note: This must be a 'sh' compatible script# Solaris8 uses sh to source the script. It is not run at startup## Note: This file should be installed into /etc/init.d# May need addional configuration to add the file to the startup sequencepid=0#pid null if not running, pid if runningcheck_running() {pid=`ps -fe|grep java|grep abtdD.jar|awk '{print $2}'`}start() {# Start daemons.check_runningif [ "$pid" ]; thenecho 'running'elseecho 'starting'su - buildadm -c 'source /etc/profile;unset GBE_PLATFORM;jats -NoExportVars eprog /home/buildadm/buildtool/abtlaunch 2>/tmp/buildtool 1>&2' &fi}stop() {# Stop daemons.check_runningecho "check_running returned $pid"if [ "$pid" ]; thenfor kpid in $pid ; doecho "killing $kpid"kill -9 $kpid 2>/dev/null 1>&2doneelseecho 'not running'fi}status() {# Stop daemons.check_runningif [ "$pid" ]; thenecho 'running'elseecho 'not running'fi}case "$1" instart)start;;stop)stop;;status)status buildtoolRETVAL=$?;;restart)stopstart;;*)echo $"Usage: $0 {start|stop|restart|status}"exit 1esacexit $RETVAL