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.
On Mon, Dec 13, 2010 at 04:18:48PM -0800, Matthew Hall wrote:
--- /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; }
Stupid mistake. fprintf goes after execv. You get the idea. Matthew.
On Mon, 2010-12-13 at 16:31 -0800, Matthew Hall wrote:
On Mon, Dec 13, 2010 at 04:18:48PM -0800, Matthew Hall wrote:
--- /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; }
Stupid mistake.
fprintf goes after execv.
You get the idea.
Thanks for your reports, I've committed and pushed these patches. One of them (the libexec change) was also ported to 3.0 and 3.1 since this was broken in those releases too. commit 7a714138c373ed1b1b1e38834d34f40b44505580 Author: Balazs Scheidler <bazsi@balabit.hu> Date: Fri Dec 17 10:14:07 2010 +0100 wrapper: added proper error message if exec() returns an error In case the main syslog-ng binary is not found, print an error message to stderr before exiting with rc=127. Reported-By: Matthew Hall Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> commit 0ab449d5190b58d60dc7b2647a0ac7ca05ea9144 Author: Balazs Scheidler <bazsi@balabit.hu> Date: Fri Dec 17 10:10:26 2010 +0100 configure: fixed the export of the libexecdir directory if overridden with a configure option Earlier, libexecdir was constructed in syslog-ng.h using the value of the PATH_PREFIX macro, exported by the configure script. This works OK as long as exec_prefix is not overridden on the configure command line. This patch only changes the instalation layout if exec_prefix is actually specified and it has only an effect if --enable-env-wrapper is also used. Reported-By: Matthew Hall Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> -- Bazsi
participants (2)
-
Balazs Scheidler
-
Matthew Hall