summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OS/eximon.conf-Default2
-rw-r--r--src/exim_monitor/em_main.c4
-rw-r--r--src/src/eximon.src17
3 files changed, 19 insertions, 4 deletions
diff --git a/src/OS/eximon.conf-Default b/src/OS/eximon.conf-Default
index 9e0769831..2f874ef53 100644
--- a/src/OS/eximon.conf-Default
+++ b/src/OS/eximon.conf-Default
@@ -5,7 +5,7 @@
# The name of the eximon binary, usually the same as the eximon script,
# with .bin stuck on the end.
-EXIMON_BINARY=${EXIMON_BINARY-$0.bin}
+EXIMON_BINARY="${EXIMON_BINARY-$0.bin}"
# The remaining parameters are values likely to be changed to suit the
# user's taste. They are documented in the EDITME file.
diff --git a/src/exim_monitor/em_main.c b/src/exim_monitor/em_main.c
index 7193640a5..a0b94b168 100644
--- a/src/exim_monitor/em_main.c
+++ b/src/exim_monitor/em_main.c
@@ -654,7 +654,9 @@ today.) */
if (log_file[0] != 0)
{
- (void)string_format(log_file_open, sizeof(log_file_open), "%s", CS log_file);
+ /* Do *not* use "%s" here, we need the %D datestamp in the log_file to
+ be expanded! */
+ (void)string_format(log_file_open, sizeof(log_file_open), CS log_file);
log_datestamping = string_datestamp_offset >= 0;
LOG = fopen(CS log_file_open, "r");
diff --git a/src/src/eximon.src b/src/src/eximon.src
index d8b3b3182..2211c58a6 100644
--- a/src/src/eximon.src
+++ b/src/src/eximon.src
@@ -19,6 +19,14 @@
# PROCESSED_FLAG
+# See if caller wants to invoke gdb
+
+use_gdb=''
+
+case ${1:-foo} in
+ gdb*) use_gdb="$1"; shift ;;
+esac
+
# Save arguments (can be the usual X parameters)
cmd_args="$@"
@@ -181,8 +189,13 @@ export EXIM_PATH LD_LIBRARY_PATH \
# Exec to the program we really want to run, thereby continuing in
# just the one process, and let it run in parallel with whatever
-# called this script.
+# called this script (unless gdb was requested in original $1).
-exec ${EXIMON_BINARY} $cmd_args &
+if [ "${use_gdb:-}" = "" ] ; then
+ exec "${EXIMON_BINARY}" $cmd_args &
+else
+ exec "$use_gdb" "${EXIMON_BINARY}" $cmd_args
+ # not backgrounded
+fi
# End