If I want to run zopectl (from v2.7.0) in daemon mode, how do I pass a socket handle to zdctl? -- John
John Poltorak wrote:
If I want to run zopectl (from v2.7.0) in daemon mode, how do I pass a socket handle to zdctl?
zopectl is a controller process, which either runs Zope in the foreground (its 'foreground' command), or launches a zdctl-controlled daemon (its 'start' command). It *never* handles sockets itself. I routinely symlink 'zopectl' to /etc/init.d/zope (RedHat style) and "chkconfig zope on", which then causes it to start the daeamon during init. Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
On Tue, Oct 19, 2004 at 11:47:32AM -0400, Tres Seaver wrote:
John Poltorak wrote:
If I want to run zopectl (from v2.7.0) in daemon mode, how do I pass a socket handle to zdctl?
zopectl is a controller process, which either runs Zope in the foreground (its 'foreground' command), or launches a zdctl-controlled daemon (its 'start' command). It *never* handles sockets itself.
I guess what I want to know is how to specify the '-s' parameter to zdctl... I'm assuming that zopectl is the program that starts zdctl.
Tres. -- =============================================================== Tres Seaver tseaver@zope.com Zope Corporation "Zope Dealers" http://www.zope.com
-- John
On Tue, 19 Oct 2004 17:00:37 +0100, John Poltorak <jp@warpix.org> wrote:
I guess what I want to know is how to specify the '-s' parameter to zdctl... I'm assuming that zopectl is the program that starts zdctl.
I think I see what you're getting at. zdctl can be viewed as a command-line script or as a Python module (zdaemon.zdctl); zopectl is a command-line script that does the later. zopectl extends the classes in zdaemon.zdctl to provide it's own implementation. The *ctl script, when run in daemonizing mode, runs the zdrun script (also found in the zdaemon package), which in turn runs the Zope server process. There is no process for zdctl separate from the zopectl process in this case. You should be able to use -s directly on the zopectl command line. Did you have a problem invoking it that way? -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> Zope Corporation
On Tue, Oct 19, 2004 at 01:54:43PM -0400, Fred Drake wrote:
You should be able to use -s directly on the zopectl command line.
That is what I was hoping...
Did you have a problem invoking it that way?
If you run 'zopectl -h' you'll see that '-s' is not an available option - at least not here under zope 2.7.0.
-Fred
-- Fred L. Drake, Jr. <fdrake at gmail.com> Zope Corporation
-- John
On Tue, 19 Oct 2004 18:59:43 +0100, John Poltorak <jp@warpix.org> wrote:
If you run 'zopectl -h' you'll see that '-s' is not an available option - at least not here under zope 2.7.0.
I don't have a convenient copy of 2.7.0 to check, so I'm not sure. Have you tried? It's possible that it simply wasn't properly documented in that release. It's also possible it's just not there. On the head of the 2.7 maintenance branch, the zopectl script is simply a shell script that runs the zdctl.py script directly, so there shouldn't be any problem using -s with more recent versions of 2.7.x. It's up to you whether a more recent version is an option. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> Zope Corporation
On Tue, Oct 19, 2004 at 02:52:30PM -0400, Fred Drake wrote:
On Tue, 19 Oct 2004 18:59:43 +0100, John Poltorak <jp@warpix.org> wrote:
If you run 'zopectl -h' you'll see that '-s' is not an available option - at least not here under zope 2.7.0.
I don't have a convenient copy of 2.7.0 to check, so I'm not sure. Have you tried?
Yes, it says:- Error: option -s not recognized
It's possible that it simply wasn't properly documented in that release. It's also possible it's just not there.
On the head of the 2.7 maintenance branch, the zopectl script is simply a shell script that runs the zdctl.py script directly, so there shouldn't be any problem using -s with more recent versions of 2.7.x. It's up to you whether a more recent version is an option.
I'd be surprised if any 2.7.x version worked differently... If I knew where zdctl was called in zopectl, I would hardcode it in just to see if it worked, but Python isn't my forte.
-Fred
-- Fred L. Drake, Jr. <fdrake at gmail.com> Zope Corporation
-- John
John Poltorak wrote at 2004-10-19 17:00 +0100:
... I guess what I want to know is how to specify the '-s' parameter to zdctl... I'm assuming that zopectl is the program that starts zdctl.
Maybe, you explain what you need to achieve... I use "zdaemon" extensively and never felt the need to control its control socket (via "-s"). However, I use often the "socket-name" attribute in the "runner" section of the configuration file. I checked Zope's schema and detected: the section is "zoperunner" for Zope -- but it lacks "socket-name". This means: a code change should really have a need to control the socket... -- Dieter
On Wed, Oct 20, 2004 at 08:09:54PM +0200, Dieter Maurer wrote:
John Poltorak wrote at 2004-10-19 17:00 +0100:
... I guess what I want to know is how to specify the '-s' parameter to zdctl... I'm assuming that zopectl is the program that starts zdctl.
Maybe, you explain what you need to achieve...
I use "zdaemon" extensively and never felt the need to control its control socket (via "-s"). However, I use often the "socket-name" attribute in the "runner" section of the configuration file.
I checked Zope's schema and detected: the section is "zoperunner" for Zope -- but it lacks "socket-name". This means: a code change should really have a need to control the socket...
The reason I need to specify the name of the socket is because I'm running under OS/2 which handles sockets slightly differently and whereas the default socket name works under Unix, it doesn't under OS/2. The '-s' parameter to zdctl looks as though it might provide a convenient way of specifying the socket name, but I can't figure out where to invoke it. Maybe I can specfify socket name in zope.conf... I don't know. A recent OS/2 port of Python (2.3.4) provides support for AF_UNIX sockets but they need to by identified by OS/2 naming conventions. All I want to do is see how well this support works.
-- Dieter
-- John
participants (4)
-
Dieter Maurer -
Fred Drake -
John Poltorak -
Tres Seaver