[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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; 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.&nbsp; 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.&nbsp; 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".&nbsp; this occurs with any arguement that i issue, =
even=20
none..&nbsp; when the server is booting, and it is starting local =
packages, it=20
echos "echo_success: not found".&nbsp; below is the content of the=20
script:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-=3D-=3D-=3D-=3D-</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>case "$1" in<BR>&nbsp; =
start)<BR>&nbsp;&nbsp; #=20
Check if zope is already running<BR>&nbsp;&nbsp; if [ ! -f =
/var/lock/subsys/zope=20
] ; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo -n 'Starting zope =
daemon:=20
'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/zope/Zope-2.3.3-src/start =
2&gt;=20
/dev/null<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
i=3D0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while [ $i -lt 90 ];=20
do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ -f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] &amp;&amp;=20
break<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 1 =
&amp;&amp;=20
echo -n "."<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let=20
i=3Di+1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
done<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
if [ $i -ge 90 ] ; =
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo=20
"Time out."<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit=20
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cat=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid &gt;=20
/var/lock/subsys/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 touch=20
/var/lock/subsys/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 cat=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid &gt;=20
/var/run/zope.pid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
touch=20
/var/run/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo " =

OK"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<BR>&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "zope already=20
running."<BR>&nbsp;&nbsp; fi<BR>&nbsp;&nbsp; echo<BR>&nbsp;&nbsp; =
;;<BR>&nbsp;=20
stop)<BR>&nbsp;&nbsp; echo -n 'Stopping zope daemon: '<BR>&nbsp;&nbsp; [ =
-f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] &amp;&amp; kill `cat=20
/home/zope/zope/var/Z2.pid`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm -f=20
/var/lock/subsys/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm -f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; rm=20
-f =
/usr/local/zope/Zope-2.3.3-src/var/pcgi.soc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
rm -f=20
/usr/local/zope/Zope-2.3.3-src/var/Data.fs.lock<BR>&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
rm -f=20
/usr/local/zope/Zope-2.3.3-src/var/zProcessManager.pid<BR>&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
echo " OK"<BR>&nbsp;&nbsp; echo<BR>&nbsp;&nbsp; ;;<BR>&nbsp;=20
reload|restart)<BR>&nbsp;&nbsp; $0 stop<BR>&nbsp;&nbsp; $0 =
start<BR>&nbsp;&nbsp;=20
;;<BR>&nbsp; status)<BR>&nbsp;&nbsp; if [ -f=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid ] ; =
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
cat /usr/local/zope/Zope-2.3.3-src/var/Z2.pid &gt;=20
/var/lock/subsys/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp; touch=20
/var/lock/subsys/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp; cat=20
/usr/local/zope/Zope-2.3.3-src/var/Z2.pid &gt;=20
/var/run/zope.pid<BR>&nbsp;&nbsp;&nbsp;&nbsp; touch=20
/var/run/zope<BR>&nbsp;&nbsp;&nbsp;&nbsp; echo "zope (pid `head -1=20
/var/run/zope.pid`) is running..."<BR>&nbsp;&nbsp;=20
else<BR>&nbsp;&nbsp;&nbsp;&nbsp; echo "zope not =
running."<BR>&nbsp;&nbsp;=20
fi<BR>&nbsp;&nbsp; ;;<BR>&nbsp; *)<BR>&nbsp;&nbsp; echo "Usage:=20
/usr/local/etc/rc.d/zope.sh =
{start|stop|restart|reload|status}"<BR>&nbsp;&nbsp;=20
exit 1<BR>esac</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>-=3D-=3D-=3D-=3D-</FONT></DIV>
<DIV>&nbsp;</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).&nbsp; in saying that, i can only wonder if this is a permission =
error,=20
but im not sure...&nbsp; the attribs of the script are 755,=20
executable.</FONT></DIV>
<DIV>&nbsp;</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--