[syslog-ng] SIGHUP kills syslog-ng on FreeBSD 3-STABLE

Balazs Scheidler bazsi@balabit.hu
Thu, 9 Dec 1999 19:01:00 +0100


On Wed, Dec 08, 1999 at 03:38:42AM +0100, Lowkrantz, Goran wrote:
> Hi,
> 
> No, it didn't help. Now it just dies silently, not even a work on the
> console.
> 
> The only thing I can see is that if I start the old syslogd immediately
> after syslog-ng died on HUP, I get the following on the console:
> syslogd: cannot create /var/run/log: Address already in use

I have yet another patch which should really fix your problems under BSD.
Touch afinet.c.x and afunix.c.x before rebuilding, if you don't have scsh
installed.

diff -urN syslog-ng-1.3.6/src/afinet.c syslog-ng.bsd/src/afinet.c
--- syslog-ng-1.3.6/src/afinet.c	Tue Nov 23 20:45:45 1999
+++ syslog-ng.bsd/src/afinet.c	Thu Dec  9 16:31:34 1999
@@ -269,11 +269,15 @@
 	case AFSOCKET_DGRAM: {
 		struct afsocket_source_connection *conn;
 		struct io_fd *client = make_io_fd(cfg->backend, fd);
+		int res;
 
 		self->super.num_connections = 1;
 		conn = make_afinet_source_connection(client, NULL, &self->super, self->super.super.super.next);
-		LOG_HANDLER_INIT(conn, cfg, NULL);
-
+		res = LOG_HANDLER_INIT(conn, cfg, NULL);
+		if ((res & ST_FAIL) == 0) {
+			conn->queue_node = 
+				object_queue_add_tail(self->super.connections, &conn->super.super.super);
+		}
 		break;
 	}
 	default:
diff -urN syslog-ng-1.3.6/src/afunix.c syslog-ng.bsd/src/afunix.c
--- syslog-ng-1.3.6/src/afunix.c	Tue Nov 23 20:32:37 1999
+++ syslog-ng.bsd/src/afunix.c	Thu Dec  9 16:33:15 1999
@@ -241,11 +241,16 @@
 	case AFSOCKET_DGRAM: {
 		struct afsocket_source_connection *conn;
 		struct io_fd *client = make_io_fd(cfg->backend, fd);
-					
+		int res;
+				
 		self->super.num_connections = 1;
 		conn = make_afunix_source_connection(client, NULL, &self->super, self->super.super.super.next);
-		LOG_HANDLER_INIT(conn, cfg, NULL);
-
+		res = LOG_HANDLER_INIT(conn, cfg, NULL);
+		
+		if ((res & ST_FAIL) == 0) {
+			conn->queue_node = 
+				object_queue_add_tail(self->super.connections, &conn->super.super.super);
+		}
 		break;
 	}
 	default:


-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
     url: http://www.balabit.hu/pgpkey.txt