My ISP rebooted my servers by accident this morning which prompted me to
get around to writing init scripts for webkit on FreeBSD 4.3.
"start" and "stop" seem to work ok but "restart" only works if there is
no load on the server since the start doesn't wait for the stop to
complete. Any ideas on fixing that? Is there a way to sleep until the
old PID is killed?
The "functions" library doesn't seem to exist on BSD and "pushd" and
"popd" only seem to exist in csh so I changed them to "cd" and "cd -".
I got rid of "success" because I don't know what it does and can't find
its equivalent. Anyone know?
-Jeff
Here's my script so far:
#!/bin/sh
#
# Startup script for WebKit
# on FreeBSD systems.
#
# See Webware/WebKit/Docs/InstallGuide.html for instructions.
# chkconfig: 2345 75 25
# description: WebKit is Python application server, part of Webware.
#WEBKIT_DIR=/usr/Webware/WebKit
WEBKIT_DIR=/usr/local/deg/www/EA/webkit
PID_FILE=/usr/local/deg/www/EA/webkit/appserverpid.txt
LOG=/usr/local/deg/logs/EA/webkit_ea.log
PYTHONPATH=
PYTHONPATH_ADDONS=
[ -f $WEBKIT_DIR/AppServer ] || exit 0
case "$1" in
start)
echo -n "Starting WebKit: "
cd $WEBKIT_DIR > /dev/null
PYTHONPATH="$PYTHONPATH $PYTHONPATH_ADDONS" ./AppServer
>> $LOG 2>&1 &
#echo $! > $PID_FILE
cd - > /dev/null
#success "Starting WebKit"
echo
;;
stop)
echo -n "Shutting down WebKit: "
kill `cat $PID_FILE`
#success "Shutting down WebKit"
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: webkit {start|stop|restart}"
exit 1
esac
exit 0
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss