[syslog-ng] Patch for launch path bug in syslog-ng.h
Matthew Hall
mhall at mhcomputing.net
Tue Dec 14 01:18:48 CET 2010
Hello,
When compiling syslog-ng 3.2.1 into my environment I discovered a bug in
how this configure option is applied:
--libexecdir=/home/y/libexec64
When this option is entered, this is generated in lib/syslog-ng.h:
#if ENABLE_ENV_WRAPPER
#define PATH_SYSLOGNG PATH_PREFIX "/libexec/syslog-ng"
#endif
As you can see this is a hard coded libexec path which does not match
what my environment expects.
Unfortunately it appears that the libexec variable never makes it into a
C macro so I'm not totally clear on how to make a permanent patch for
this one. I will work around it with something like this temporary patch
for now.
--- /home/megahall/syslog-ng.h 2010-12-13 15:54:56.000000000 -0800
+++ syslog-ng-3.2.1/lib/syslog-ng.h 2010-12-13 16:06:22.000000000 -0800
@@ -44,7 +44,7 @@
#define PATH_PIDFILE PATH_PIDFILEDIR "/syslog-ng.pid"
#define PATH_CONTROL_SOCKET PATH_PIDFILEDIR "/syslog-ng.ctl"
#if ENABLE_ENV_WRAPPER
-#define PATH_SYSLOGNG PATH_PREFIX "/libexec/syslog-ng"
+#define PATH_SYSLOGNG PATH_PREFIX "/libexec64/syslog-ng"
#endif
#define PATH_PERSIST_CONFIG PATH_LOCALSTATEDIR "/syslog-ng.persist"
Another issue. Because of this bug syslog-ng fails to launch with return
code 127. But it prints nothing to the console explaining why it failed:
execve("/home/y/libexec/syslog-ng", ["/home/y/sbin64/syslog-ng"], [/* 21 vars */]) = -1 ENOENT (No such file or directory)
exit_group(127) = ?
I think some message should be added in syslog-ng/wrapper.c. This is an
uncompiled example but should be very close.
--- /home/megahall/wrapper.c 2010-12-13 16:15:29.000000000 -0800
+++ syslog-ng-3.2.1/syslog-ng/wrapper.c 2010-12-13 16:14:21.000000000 -0800
@@ -45,6 +45,7 @@
putenv(ldlibpath);
}
#endif
+ fprintf(stderr, "syslog-ng failed to launch because of XYZ\n");
execv(PATH_SYSLOGNG, argv);
return 127;
}
Thanks for maintaining syslog-ng. I hope this helps keep the product
great!
Regards,
Matthew Hall.
More information about the syslog-ng
mailing list