[Xastir] Strange question....

Curt, WE7U archer at eskimo.com
Mon Mar 7 12:13:35 EST 2005


On Mon, 7 Mar 2005, Dan Brown wrote:

> +    /* Save our PID */
> +
> +    FILE * MYPID ;
> +
> +    MYPID = fopen(get_user_base_dir("xastir.pid"),"w");
> +    fprintf(MYPID, "%d",getpid());
> +    fclose (MYPID);
> +

> (prolly need to add some code to remove the .pid file, at some point, too,
> maybe after coffee...)

A PID file briefly crossed my mind while I was answering the
question (as in it sure would have been easier if we had one!).
Having a PID file would be useful during debugging too, when it
hangs but doesn't die.

For that matter, if we have a PID file we can detect when we have
another Xastir running and switch our config files to an alternate
set, or refuse to bring up the second copy, etc.

--
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