[Xastir] Strange question....

Curt, WE7U archer at eskimo.com
Mon Mar 7 17:45:40 EST 2005


On Mon, 7 Mar 2005, Curt, WE7U wrote:

> On Mon, 7 Mar 2005, Curt, WE7U wrote:
>
> > On Mon, 7 Mar 2005, Dan Brown wrote:
> >
> > > Well, that code should do what you need to do - save for removing it at the
> > > end.  I just hadn't had enough (any) coffee, so one round of source code
> > > diving was all for me this morning ;-)
> >
> > It's a great start, and much appreciated!
> >
> > Here's what we need to start really using it:
> >
> >
> >   Check for a pre-existing PID file.
> >     If one found, check whether the process corresponding to the
> >     process ID in the file is still running.
> >       If so, refuse to start up, or start up with a secondary config
> >       directory.
> >
> >   Remove only our own PID file when we exit.
> >
> >
> > This brings up another question:  Whether we might want one master
> > PID file and some slave PID files?  The master PID would be written
> > by an Xastir that is using the default config files (and typically
> > would have its listening port enabled so that slave Xastirs could
> > connect to it).  The slave PID's would be written by Xastir sessions
> > that are using alternative config schemes.
> >
> > Am just thinking of the case where you might have two or more Xastir
> > sessions running with the slaves pulling data from the master, and
> > the master gets killed somehow.  Bringing it back up without the
> > two-layer scheme might have it trying to come up with a secondary
> > config set, where you really want the default configs.
> >
> > Somehow we need to tie the PID files together with the config setup
> > they're using.  We could write the config directory into the file as
> > well, which might be a good idea here, then just specify the config
> > directory as an input on the command-line.  That way the PID files
> > could all be on an equal footing.
>
> Also, the "check user directories" stuff would have to be moved
> below the getopts processing so that we could add another
> command-line option for selecting which config directory to use.
> We'd also have to go through all the code to make sure the file &
> directory names were kept separate.  This would be a worthwhile
> endeavor 'cuz then we could run multiple Xastir's under one login
> and they wouldn't get in each other's way.

Yet another note:  Grep for "lockfile" and "lock file" in
interface.c and you'll find example code for the serial port
lockfiles we do now.  We assume that we have full control over the
port.  This is another place where we'd have to do more careful
checking to make sure we're doing the right thing if running
multiple Xastirs as one user.

Every open/fopen/fdopen/opendir/close/fclose/closedir/unlink/fseek/rewind
call would have to be checked.  Others?.

--
Curt, WE7U.   APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Xastir mailing list