ok, the simple answer is if you want to use bfsmd, setting up a separate server script won't do much good. The problem is bfsmd does not have any way to shut it down from the command line. That said, since I said I would write one, here is a script using bfsmd. Put it in a file called rc.bfsmd in your /etc/rc.d directory modifying user name and paths as appropriate:
Code:
#!/bin/sh
#
# /etc/rc.d/rc.bfsmd
#
#
case "$1" in
'start')
echo "starting bfsmd server"
su - bf1942user -c "/path/to/bfsmd/bfsmd -path /path/to/server/executable &" ;;
'stop')
echo "stopping bfsmd server"
killall bfsmd ;;
'restart')
echo "stopping bfsmd server"
killall bfsmd
echo "restarting bfsmd server"
su - bf1942user -c "/path/to/bfsmd/bfsmd -path /path/to/server/executable &" ;;
*)
echo "usage $0 start|stop|restart" ;;
esac
then in rc.local add this:
Code:
if [ -x /etc/rc.d/rc.bfsmd ]; then
. /etc/rc.d/rc.bfsmd start
fi
If you want the server to start make sure rc.bfsmd is executable. If you decide you don't want it to start just remove execution permission. You don't have to do anything in close in this case since rc.0 effectively does the same thing as I am doing on stop, though at a larger scale.
I am not sure what bfsmd gives you versus starting the server with start.sh +statusMonitor 1. start.sh could be set up with a script as well, though in that case I would put it in a screen since it actually has a meaningful UI. It could also be set with a cleaner way to close, though there is nothing wrong with a killall in this case since it is using signal 15.