Modify

#476 closed defect (fixed)

forked process should unconditionally close fd 0-2

Reported by: dato@… Owned by:
Priority: normal Milestone:
Component: BitlBee Version: devel
Keywords: Cc:
IRC client+version: Client-independent Operating System: Public server
OS version/distro:

Description

Hello,

I was observing that when starting a bitlbee process from my crontab, a zombie process was being left around.

This happens because the forked process in bitlbee_daemon_init() only closes file descriptors 0 to 2 if they are a tty. However, for processes started from cron those file descriptors are pipes, but they should be closed nevertheless.

I've verified that removing the three "isatty" calls fixes the issue. I'm not sure, given the comment, what side-efects this could have.

Thanks for considering.

Attachments (0)

Change History (2)

comment:1 Changed at 2010-03-14T16:25:46Z by wilmer

Hey Dato!

I'm not sure why the isatty() calls are there anyway, but I think it's related to the forkdaemon RESTART command, to avoid accidentally closing sockets to real users.

A work-around would be to close them but reopen them to /dev/null though, so that it's always safe to close them.

comment:2 Changed at 2010-03-14T16:36:49Z by wilmer

Resolution: fixed
Status: newclosed

Congratulations, this is fixed in CL changeset:devel,500 :-)

Modify Ticket

Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.