Re: starting big brother at boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don Dupy wrote:
I have big brother installed on my server
I was wondering how I would write in a script
to start big brother when the machine boots.

I have to su to user bb then execute /var/www/html.....././runbb.sh start

how would I do that automatically?

See attached script. Modify to match what you have. Save as /etc/init.d/bb, and chmod 755. Than do "chkconfig bb on" as root.


--
Aleksandar Milivojevic <amilivojevic@xxxxxx>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7
#! /bin/bash
#
# bb           Start/Stop the Big Brother system.
#
# chkconfig: 345 10 99
#

# Source function library.
. /etc/init.d/functions

RETVAL=0
RUNBB="/wherever/your/bb/is/runbb.sh"

# See how we were called.
  
prog="Big Brother"

start() {
	su - -c "$RUNBB start" bb
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bb
	return $RETVAL
}

stop() {
	su - -c "$RUNBB stop" bb
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bb
	return $RETVAL
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  *)
	echo $"Usage: $0 {start|stop}"
	exit 1
esac

exit $?

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux