Petter, as I can't reproduce this problem myself, could you test the attached
patch and see if it fixes your problem.

Thanks,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
commit 6511278082a7e1e9602385cd24cdb5e363cb702f
Author: Rainer Gerhards <[email protected]>
Date:   Mon Jun 29 12:40:41 2009 +0200

    bugfix: ssh session hangs after rsyslgod is started from it
    
    stderr/stdout were not closed to be able to emit error messages,
    but this caused ssh sessions to hang. Now we close them after the
    initial initialization. See forum thread:
    http://kb.monitorware.com/controlling-terminal-issues-t9875.html

diff --git a/ChangeLog b/ChangeLog
index 6ee2e6b..6683631 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 ---------------------------------------------------------------------------
+Version 4.2.1  [v4-stable] (rgerhards), 2009-0?-??
+- bugfix: stderr/stdout were not closed to be able to emit error messages,
+  but this caused ssh sessions to hang. Now we close them after the 
+  initial initialization. See forum thread:
+  http://kb.monitorware.com/controlling-terminal-issues-t9875.html
+---------------------------------------------------------------------------
 Version 4.2.0  [v4-stable] (rgerhards), 2009-06-23
 - bugfix: light and full delay watermarks had invalid values, badly
   affecting performance for delayable inputs
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 77273be..45c5566 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -3015,7 +3015,6 @@ static rsRetVal mainThread()
 		glbl.SetHUPisRestart(0); /* we can not do restart-type HUPs with dropped privs */
 	}
 
-
 	/* END OF INTIALIZATION
 	 * ... but keep in mind that we might do a restart and thus init() might
 	 * be called again. If that happens, we must shut down the worker thread,
@@ -3024,6 +3023,19 @@ static rsRetVal mainThread()
 	 */
 	dbgprintf("initialization completed, transitioning to regular run mode\n");
 
+	/* close stderr and stdout if they are kept open during a fork. Note that this
+	 * may introduce subtle security issues: if we are in a jail, one may break out of
+	 * it via these descriptors. But if I close them earlier, error messages will (once
+	 * again) not be emitted to the user that starts the daemon. As root jail support
+	 * is still in its infancy (and not really done), we currently accept this issue.
+	 * rgerhards, 2009-06-29
+	 */
+	if(!(Debug || NoFork)) {
+		close(1);
+		close(2);
+		bErrMsgToStderr = 0;
+	}
+
 	mainloop();
 
 finalize_it:

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to