[ZODB-Dev] Daemon manager design issues

Jeff Rush jrush@taupro.com
Wed, 13 Nov 2002 12:17:28 -0600


Guido van Rossum wrote:
> 
> > On Monday 11 November 2002 2:34 pm, Guido van Rossum wrote:
> >
> I've decided for now to always cd into /, as part of the daemonizing.
> Core dumps of Python aren't very enlightening in my experience, and
> the application can cd into its own var directory if it wants to.

This seems to be the convention -- daemons with no data of their
own cd to / and disable core dumps, others cd to where their data
resides.


> > I think you misunderstand. daemonutils has a working directory for
> > each application that it is monitoring.
> >
> OK, but this concept doesn't apply to how I would like the zdaemon
> script to work.  Having a directory with a run script is simply not
> how I want this to work.

Oh.  I figured you'd stick with the Zope convention (not seen
elsewhere by me) of instance identity == var directory.  Always
seemed awkward to me, but very Zopeish. ;-)


> > > > Using the status reporting tool. We protect against two copies
> > > > of the manager process, *not* two copies of the application.
> > >
> > > But how do two copies of the manager process know that they are
> > > managing the same application?
> >
> > Because they share the same per-application daemon manager working
> > directory (assuming we have one ;-)
> 
> I currently do this via the name of the unix domain socket used for
> communication.

So where are you storing/expecting the sockets to reside?  I
believe currently Zope/PCGI stores them in the var directory
of each instance.

The Filesystem Hierarchy Standard for Linux suggests /var/run:

   http://www.pathname.com/fhs/2.2/fhs-5.13.html

for storing transient UNIX-domain sockets that get cleared on
each boot.  Or do you keep the sockets persistently across boots,
to maintain instance identity, unlike the way PCGI works?

One item of note is that /var/run *MUST* be non-writable by
normal users or security suffers.  Will the Daemon Manager
always run as root?

Persistent non-logging, non-spooled, non-user-manipulatable,
boot-surviving per-app data should be kept in /var/lib/<appname>.

    http://www.pathname.com/fhs/2.2/fhs-5.8.html

The permissions on the <appname> directory can be anything
you want, which may be more suitable to Zope usage patterns.

-Jeff Rush