Martin, this happens because in control.c we log each argument for start
and stop and if syslog is used 'vsyslog' adds a newline to each log
line. If we had StringBuffer we could build the argument string and log
in one go, though I suggest that we for now only log the first argument
so the code below
LogInfo("'%s' start: ", s->name);
while(s->start->arg[i]) {
if(i) LogInfo(" ");
LogInfo("%s", s->start->arg[i++]);
}
Becomes this
LogInfo("'%s' start: %s", s->name, s->start->arg[0]);
and do the same for the stop command.
On 26. mars. 2008, at 09.31, Brian Candler wrote:
I only notice a minor anomoly now, which is spurious blank lines in
syslog:
Mar 26 08:25:25 localhost monit[24709]: 'testapp_pen.conf' checksum
was changed for /etc/pen.d/testapp.conf
Mar 26 08:25:25 localhost monit[24709]: 'testapp_pen.conf' trying to
restart
Mar 26 08:25:25 localhost monit[24709]: 'testapp_pen' stop:
Mar 26 08:25:25 localhost monit[24709]: /bin/bash
Mar 26 08:25:25 localhost monit[24709]:
Mar 26 08:25:25 localhost monit[24709]: -c
Mar 26 08:25:25 localhost monit[24709]:
Mar 26 08:25:25 localhost monit[24709]: kill -s SIGTERM `cat
/var/run/pen/testapp.pid`
Mar 26 08:25:25 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: 'testapp_pen' start:
Mar 26 08:25:26 localhost monit[24709]: /usr/bin/pen
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: -F
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: /etc/pen.d/testapp.conf
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: -u
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: nobody
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: -p
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: /var/run/pen/testapp.pid
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: -C
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: 127.0.0.1:9999
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:26 localhost monit[24709]: 127.0.0.1:10000
Mar 26 08:25:26 localhost monit[24709]:
Mar 26 08:25:57 localhost monit[24709]: 'testapp_pen.conf' checksum
has not changed
The corresponding config lines are:
check process testapp_pen
with pidfile /var/run/pen/testapp.pid
start program = "/usr/bin/pen -F /etc/pen.d/testapp.conf -u nobody
-p /var/run/pen/testapp.pid
-C 127.0.0.1:9999 127.0.0.1:10000"
stop program = "/bin/bash -c 'kill -s SIGTERM `cat
/var/run/pen/testapp.pid`'"
...
_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev