Re: [Freeciv-Dev] backgrounding civserver causes weird problems
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Gary Moyer (garymoyer@xxxxxxxx) wrote:
> I've noticed that if the server is backgrounded (and nohup'd) the server
> hangs the next time input occurs on the same tty on which the game was
> started.
> I looked at sniff_packets() and it adds descriptor 0 to the file
> descriptor set which is used by select(). Isn't there a programatic way
> of determining if the process has been nohup'd and essentially not
> adding this descriptor to the descriptor set for use by select()?
You can check to see whether signal 1 is being handled by the default
signal handler (process death), but what you really want to know is
whether the process is running in the background.
As far as I know, there's no way to do this. (Corrections are welcome.)
It would probably make more sense to add a command-line switch to the
server which omits 0 from the select() list, for background running.
You could even make the server put itself in the background when this
switch is specified, making the "nohup" and "&" unnecessary -- much like
a traditional Unix daemon.
--
Greg Wooledge | Distributed.NET http://www.distributed.net/
wooledge@xxxxxxxxxxx | because a CPU is a terrible thing to waste.
http://www.kellnet.com/wooledge/ |
|
|