On Mon, Dec 14, 2009 at 9:43 AM, Kārlis Repsons <repsons@gmail.com> wrote:
On Monday 14 December 2009 07:07:37 Balazs Scheidler wrote:
> On Fri, 2009-12-11 at 19:11 +0000, Kārlis Repsons wrote:
> > People,
> >
> > I wonder why is there some two messages like this in errors log each day:
> > supervise/syslog-ng[28806]: Daemon exited gracefully, not restarting;
> > exitcode='0'
> >
> > ?
> >
> > What are the possible reasons and what should be done?
>
> something has stopped syslog-ng. if it is intended, nothing needs to be
> done, if it isn't, then you need to find out what stops syslog-ng.
>
> the exitcode of 0 means that it was an intentional stop, not an abort or
> a segfault.
Is it necessarily syslog-ng itself? I have a problematic errors reporting
script connected to syslog-ng as a destination, maybe it exits and causes
this? Otherwise I wouldn't like this a lot, because just a minute ago was
"exit 0", but when I look, syslog-ng is working just fine... And no stop/start
of syslog-ng is logged. And that script WAS restarted.
Ok, at this point, I presume, its that script, which causes it...

So, please, take a look at this script:


#!/bin/bash

tmpp="/tmp/crashmail-pipe"

if [[ ! -p "$tmpp" ]]
then
   umask u=rwx,go=
   mkfifo "$tmpp"
fi

while read -r line
do
  (
   echo -en "From:crashmail@host\nTo:root@host\nSubject:" >> "$tmpp" &&
   echo "$line" | cut -c 1-100 >> "$tmpp" &&
   echo "$line" >> "$tmpp"
  ) &
   cat "$tmpp" | sendmail root@host
   if [[ $? -ne 0 ]]
   then
      exit 1
   fi
done


Well, ok, its not doing very well, for example I can't understand how comes, I
receive an output like:


No Subject
From: root <root@host>
To: undisclosed-recipients:
Date: Today 17:20:02

Dec 13 17:10:01 host2 supervise/syslog-ng[9735]: Daemon exited gracefully, not
restarting; exitcod
Dec 13 17:10:01 host2 supervise/syslog-ng[9735]: Daemon exited gracefully, not
restarting; exitcode='0'
From:crashmail@host
To:root@host
Subject:


Do these messages show up around 17:00 daily? Are you sure this isn't just your logrotate scripts doing a reload/restart on syslog-ng?
 

--
Lance