I'm stuck getting Zope to start on boot RH7
subject really says it all. From the command line, in /etc/init.d/ I can execute a script called zope which starts Zope properly (I can see it with ps -ef). Using Control Panel, I've placed zope in the start and stop places properly, and upon boot, there is a message that Zope has been started (OK), but ps -ef tells me that this is not so, i.e., it's been stopped somehow. Can someone suggest things I should do? I got this going on RH6, on a sparc machine, but this is a i386 machine and a slightly higher level of RH. Thanks Carl David david@uconnvm.uconn.edu
Since Redhat 7, the init.d functionality has changed. You must now use chkconfig to not only create symlinks in the staged rc.# directories, but you need the inclusion of a function file. What happens is the you must create a script in /etc/rc.d/init.d/zope2 that has an intelligent method of querying a script such as start. This script must be able to understand the following: /etc/rc.d/init.d/zope2 start /etc/rc.d/init.d/zope2 stop /etc/rc.d/init.d/zope2 restart /etc/rc.d/init.d/zope2 status You cannot take start now and place it in init.d. In Redhat 7+ I suggest you check the atd script for an example. Here is a script I modified for zope, that works, but not entirely: #!/bin/bash # # /etc/rc.d/init.d/zope2 # # Starts the Zope daemon # # chkconfig: 345 85 85 # description: Zope server. . /etc/init.d/functions RETVAL=0 # # See how we were called. # prog="Zope2" start() { # Check if atd is already running echo -n $"Starting $prog: " /var/Zope-233b/start RETVAL=$? [ $RETVAL -eq 0 ] echo return $RETVAL } stop() { echo -n $"Stopping $prog: " /var/Zope-233b/stop RETVAL=$? [ $RETVAL -eq 0 ] echo return $RETVAL } restart() { stop start } reload() { restart } status_at() { status /var/Zope-233b/start } case "$1" in start) start ;; stop) stop ;; reload|restart) restart ;; condrestart) if [ -f /var/lock/subsys/atd ]; then restart fi ;; status) status_at ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit $? exit $RETVAL Hope this helps, Paz -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Carl David Sent: Wednesday, July 11, 2001 3:24 PM To: zope@zope.org Subject: [Zope] I'm stuck getting Zope to start on boot RH7 subject really says it all. From the command line, in /etc/init.d/ I can execute a script called zope which starts Zope properly (I can see it with ps -ef). Using Control Panel, I've placed zope in the start and stop places properly, and upon boot, there is a message that Zope has been started (OK), but ps -ef tells me that this is not so, i.e., it's been stopped somehow. Can someone suggest things I should do? I got this going on RH6, on a sparc machine, but this is a i386 machine and a slightly higher level of RH. Thanks Carl David david@uconnvm.uconn.edu _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Doesn't that modified atd init script run Zope as root? If so, I think that causes problems with some installations. It's been some time since I installed Zope, so I might be forgetting something. I think you might have to get the script to su to the zope user with some installs. There are other Red Hat init scripts which do this. I believe if you do a search on the zope site somebody previously posted an example of an init script which covered this. -- Bruce Tong | Got me an office; I'm there late at night. Sr. Software Engineer | Just send me e-mail, maybe I'll write. Electronic Vision / FITNE | zztong@pugsly.ev.net | -- Joe Walsh for the 21st Century
Hi Bruce, Well, in OUR setup, Zope uses port 80 directly which is inside the protected range, requiring Medusa and ZServer to run as root. BUT, should you have a normal setup, you can change the line: start() { # Check if atd is already running echo -n $"Starting $prog: " /var/Zope-233b/start RETVAL=$? [ $RETVAL -eq 0 ] echo return $RETVAL to use the SU command, something like: start() { # Check if atd is already running echo -n $"Starting $prog: " su -l zopeown '/var/Zope-233b/start' RETVAL=$? [ $RETVAL -eq 0 ] echo return $RETVAL We've done this before, but I forget the exact syntax of su to provide that it is a shell command, and run as user.... Paz -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Bruce Tong Sent: Wednesday, July 11, 2001 4:28 PM To: Zope Subject: RE: [Zope] I'm stuck getting Zope to start on boot RH7 Doesn't that modified atd init script run Zope as root? If so, I think that causes problems with some installations. It's been some time since I installed Zope, so I might be forgetting something. I think you might have to get the script to su to the zope user with some installs. There are other Red Hat init scripts which do this. I believe if you do a search on the zope site somebody previously posted an example of an init script which covered this. -- Bruce Tong | Got me an office; I'm there late at night. Sr. Software Engineer | Just send me e-mail, maybe I'll write. Electronic Vision / FITNE | zztong@pugsly.ev.net | -- Joe Walsh for the 21st Century _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Carl David writes:
subject really says it all. From the command line, in /etc/init.d/ I can execute a script called zope which starts Zope properly (I can see it with ps -ef). Using Control Panel, I've placed zope in the start and stop places properly, and upon boot, there is a message that Zope has been started (OK), but ps -ef tells me that this is not so, i.e., it's been stopped somehow. Can someone suggest things I should do? I got this going on RH6, on a sparc machine, but this is a i386 machine and a slightly higher level of RH. When you start Zope from "init.d", then it is probably run as "root" (unless you do something special).
In this case, Zope will switch personality immediately after it bound the ports. It will become "nobody" or any user you specified at installation time or via "z2.py" arguments. If this user does not have correct file system permissions, your Zope will die soon. Dieter
participants (4)
-
Bruce Tong -
Carl David -
Dieter Maurer -
Paul Zwarts