bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Close file-descriptors on daemon invocation


From: Andrew Stribblehill
Subject: [PATCH] Close file-descriptors on daemon invocation
Date: Sat, 8 Feb 2003 20:05:32 +0000
User-agent: Mutt/1.4i

I found sometimes that if I started a cfengine daemon from an SSH
session then tried to close that session, SSH would hang, because it
still had a fd open from which data could potentially come. The
attached patch makes each daemon dup stdin, stdout and stderr to
/dev/null, then closes each other file descriptor. This fixes the
problem.

It also centralises the fd-closing code into one place, misc.c.

I found a dependency between misc.c and SSL, so I moved RandomSeed to
crypto.c where it seems to fit naturally. Then I could make each
daemon link to misc.o without adding any extra #include dependencies.

The patch is against Cfengine 2.0.5b1.

BTW Mark, I'd appreciate knowing how you prefer patches. Do you like
one patch and one email per bug, or should I coalesce them?

You'll also be pleased to hear that Cfengine builds cleanly on all 10
architectures that Debian supports.

-- 
VIKING
SOUTH 5 TO 7 VEERING WEST 3 OR 4. RAIN. MODERATE OR GOOD

Attachment: 30_daemon_close_fds
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]