Hello everyone,
i am wondering if there is
anyone out there that might be able to assist me in setting up a script to run
Zope2.3.3 as a daemon on my freeBSD4.2 server. I have started with the
redhat script by Markoer, and have simply edited the paths to reflect
correctly as to my directory structure. when i attempt to execute the
script from shell by typing "/usr/local/etc/rc.d/zope.sh restart", it returns
"case: Too many arguements". this occurs with any arguement that i
issue, even none.. when the server is booting, and it is starting local
packages, it echos "echo_success: not found". below is the content of
the script:
-=-=-=-=-
case "$1" in
start)
#
Check if zope is already running
if [ ! -f
/var/lock/subsys/zope ] ; then
echo -n
'Starting zope daemon: '
/usr/local/zope/Zope-2.3.3-src/start 2>
/dev/null
i=0
while [ $i -lt 90 ];
do
[ -f
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] &&
break
sleep 1 &&
echo -n "."
let
i=i+1
done
if [ $i -ge 90 ] ; then
echo "Time out."
exit
1
else
cat
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid >
/var/lock/subsys/zope
touch
/var/lock/subsys/zope
cat
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid >
/var/run/zope.pid
touch
/var/run/zope
echo "
OK"
fi
else
echo "zope already
running."
fi
echo
;;
stop)
echo -n 'Stopping zope daemon: '
[ -f
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] && kill `cat
/home/zope/zope/var/Z2.pid`
rm -f
/var/lock/subsys/zope
rm -f
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid
rm
-f
/usr/local/zope/Zope-2.3.3-src/var/pcgi.soc
rm -f
/usr/local/zope/Zope-2.3.3-src/var/Data.fs.lock
rm -f
/usr/local/zope/Zope-2.3.3-src/var/zProcessManager.pid
echo " OK"
echo
;;
reload|restart)
$0 stop
$0
start
;;
status)
if [ -f
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] ; then
cat /usr/local/zope/Zope-2.3.3-src/var/Z2.pid >
/var/lock/subsys/zope
touch
/var/lock/subsys/zope
cat
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid >
/var/run/zope.pid
touch
/var/run/zope
echo "zope (pid `head -1
/var/run/zope.pid`) is running..."
else
echo "zope not running."
fi
;;
*)
echo "Usage:
/usr/local/etc/rc.d/zope.sh
{start|stop|restart|reload|status}"
exit
1
esac
-=-=-=-=-
note that /var/lock/subsys doesn't exist by
default on freeBSD, so for ease of use, i added those directories myself (root
owns them). in saying that, i can only wonder if this is a permission
error, but im not sure... the attribs of the script are 755,
executable.
Thank you,
Shaun