[Zope] start script for freebsd?
vertigo
vertigo" <vertigo@specialagent420.com
Wed, 15 Aug 2001 18:51:30 -0700
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C125BB.4C0320B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
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:
-=3D-=3D-=3D-=3D-
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=3D0
while [ $i -lt 90 ]; do
[ -f /usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] && break
sleep 1 && echo -n "."
let i=3Di+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
-=3D-=3D-=3D-=3D-
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
------=_NextPart_000_0007_01C125BB.4C0320B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello everyone,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> i am wondering if =
there is=20
anyone out there that might be able to assist me in setting up a script =
to run=20
Zope2.3.3 as a daemon on my freeBSD4.2 server. I have started with =
the=20
redhat script by Markoer, and have simply edited the paths to reflect =
correctly=20
as to my directory structure. when i attempt to execute the script =
from=20
shell by typing "/usr/local/etc/rc.d/zope.sh restart", it returns "case: =
Too=20
many arguements". this occurs with any arguement that i issue, =
even=20
none.. when the server is booting, and it is starting local =
packages, it=20
echos "echo_success: not found". below is the content of the=20
script:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>-=3D-=3D-=3D-=3D-</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>case "$1" in<BR> =
start)<BR> #=20
Check if zope is already running<BR> if [ ! -f =
/var/lock/subsys/zope=20
] ; then<BR> echo -n 'Starting zope =
daemon:=20
'<BR> /usr/local/zope/Zope-2.3.3-src/start =
2>=20
/dev/null<BR> =20
i=3D0<BR> while [ $i -lt 90 ];=20
do<BR> [ -f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] &&=20
break<BR> sleep 1 =
&&=20
echo -n "."<BR> let=20
i=3Di+1<BR> =
done<BR> =20
if [ $i -ge 90 ] ; =
then<BR> echo=20
"Time out."<BR> exit=20
1<BR> =20
else<BR> cat=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid >=20
/var/lock/subsys/zope<BR> =
touch=20
/var/lock/subsys/zope<BR> =
cat=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid >=20
/var/run/zope.pid<BR> =
touch=20
/var/run/zope<BR> echo " =
OK"<BR> fi<BR> =20
else<BR> echo "zope already=20
running."<BR> fi<BR> echo<BR> =
;;<BR> =20
stop)<BR> echo -n 'Stopping zope daemon: '<BR> [ =
-f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] && kill `cat=20
/home/zope/zope/var/Z2.pid`<BR> rm -f=20
/var/lock/subsys/zope<BR> rm -f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid<BR> &nbs=
p; rm=20
-f =
/usr/local/zope/Zope-2.3.3-src/var/pcgi.soc<BR> &n=
bsp;=20
rm -f=20
/usr/local/zope/Zope-2.3.3-src/var/Data.fs.lock<BR> &nbs=
p; =20
rm -f=20
/usr/local/zope/Zope-2.3.3-src/var/zProcessManager.pid<BR> &nb=
sp; =20
echo " OK"<BR> echo<BR> ;;<BR> =20
reload|restart)<BR> $0 stop<BR> $0 =
start<BR> =20
;;<BR> status)<BR> if [ -f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] ; =
then<BR> =20
cat /usr/local/zope/Zope-2.3.3-src/var/Z2.pid >=20
/var/lock/subsys/zope<BR> touch=20
/var/lock/subsys/zope<BR> cat=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid >=20
/var/run/zope.pid<BR> touch=20
/var/run/zope<BR> echo "zope (pid `head -1=20
/var/run/zope.pid`) is running..."<BR> =20
else<BR> echo "zope not =
running."<BR> =20
fi<BR> ;;<BR> *)<BR> echo "Usage:=20
/usr/local/etc/rc.d/zope.sh =
{start|stop|restart|reload|status}"<BR> =20
exit 1<BR>esac</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>-=3D-=3D-=3D-=3D-</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>note that /var/lock/subsys doesn't =
exist by default=20
on freeBSD, so for ease of use, i added those directories myself (root =
owns=20
them). in saying that, i can only wonder if this is a permission =
error,=20
but im not sure... the attribs of the script are 755,=20
executable.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Shaun</FONT></DIV></BODY></HTML>
------=_NextPart_000_0007_01C125BB.4C0320B0--