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?
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. -- Bazsi
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: I wonder... Maybe you have some suggestions how should I do better? Write a C code and collect messages for some time before disposal?!
Is it necessarily syslog-ng itself?
I suggest that you check the pid of syslog every day - if the pid changes then you know syslog-ng was restarted. Joe. -----Original Message----- From: syslog-ng-bounces@lists.balabit.hu [mailto:syslog-ng-bounces@lists.balabit.hu] On Behalf Of Karlis Repsons Sent: 14 December 2009 17:44 To: syslog-ng@lists.balabit.hu Cc: Balazs Scheidler Subject: Re: [syslog-ng] supervise/syslog-ng exits 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: I wonder... Maybe you have some suggestions how should I do better? Write a C code and collect messages for some time before disposal?!
Karlis, From the manpage of sendmail: Sendmail is not intended as a user interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre-formatted messages. Use mailx -s <subject> <address> to send stdin to the address. What is the purpose of the fifo in your script? Use a temporary file (or shell variables) to hold data before mailing. Kind regards, Siem Korteweg -----Oorspronkelijk bericht----- Van: syslog-ng-bounces@lists.balabit.hu [mailto:syslog-ng-bounces@lists.balabit.hu] Namens Karlis Repsons Verzonden: maandag 14 december 2009 18:44 Aan: syslog-ng@lists.balabit.hu CC: Balazs Scheidler Onderwerp: Re: [syslog-ng] supervise/syslog-ng exits 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: I wonder... Maybe you have some suggestions how should I do better? Write a C code and collect messages for some time before disposal?!
On Monday 14 December 2009 18:50:44 Siem Korteweg wrote:
Karlis,
From the manpage of sendmail: Sendmail is not intended as a user interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre-formatted messages.
Use mailx -s <subject> <address> to send stdin to the address. Thank you for pointing me to that!
What is the purpose of the fifo in your script? Use a temporary file ...not to use temporary file... :) But maybe I'll change my mind.
(or shell variables) I was afraid, that there might be something, which shell variable might have problems to contain, was I unnecessarily precautious about that? Can it contain newlines ($ a=$(echo); echo -n $a gives me nothing!)?
On Monday 14 December 2009 18:50:44 Siem Korteweg wrote:
Karlis,
From the manpage of sendmail: Sendmail is not intended as a user interface routine; other programs provide user-friendly front ends; sendmail is used only to deliver pre-formatted messages.
Use mailx -s <subject> <address> to send stdin to the address. I can add, that its better to use nail instead of mailx, because nail allows providing sender mail address with -r option.
On Mon, 2009-12-14 at 17:43 +0000, Kārlis Repsons 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...
The supervisor should only print this log message if syslog-ng itself has finished. Can you confirm that this is not the case? Thanks. -- Bazsi
On Tuesday 15 December 2009 13:26:56 Balazs Scheidler wrote:
On Mon, 2009-12-14 at 17:43 +0000, Kārlis Repsons 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...
The supervisor should only print this log message if syslog-ng itself has finished. Can you confirm that this is not the case? IF my grsec kernel can't be hacked (or nobody did it, which is also credible) to stop a process, then restart it with the same pid (can process choose its pid in any way?); AND IF nobody hacked my logfiles (which is indeed uneasy to do); THEN considering, that pid of syslong-ng hasn't changed ever since it was started with it (according to logfile), but the exit 0 messages has occured several times since that -- I can confirm it.
Or what, crazy world and aliens live in my server?!
Hi All! On Wed, 2009-12-16 at 10:59 +0000, Kārlis Repsons wrote:
On Tuesday 15 December 2009 13:26:56 Balazs Scheidler wrote:
On Mon, 2009-12-14 at 17:43 +0000, Kārlis Repsons 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:
day: supervise/syslog-ng[28806]: Daemon exited gracefully, not restarting; exitcode='0'
[...] IF my grsec kernel can't be hacked (or nobody did it, which is also credible) to stop a process, then restart it with the same pid (can process choose its pid in any way?); AND IF nobody hacked my logfiles (which is indeed uneasy to do); THEN considering, that pid of syslong-ng hasn't changed ever since it was started with it (according to logfile), but the exit 0 messages has occured several times since that -- I can confirm it.
If you are talking about the pid number 28806 that pid is the supervisor's pid. Which is not exit. Just the syslog-ng itself. So it is possible to receive a lot of this message with the same pid.
On Wednesday 16 December 2009 11:41:50 SZALAY Attila wrote:
If you are talking about the pid number 28806 that pid is the supervisor's pid. Which is not exit. Just the syslog-ng itself. So it is possible to receive a lot of this message with the same pid. I was writing about the pid of syslog-ng, not supervising syslog-ng!
root 26918 1 0 Dec11 ? 00:00:00 supervising syslog-ng root 26919 26918 0 Dec11 ? 00:05:00 /usr/sbin/syslog-ng However, messages in syslong-ng.log report very different pids on crash: supervise/syslog-ng[24337]: Daemon exited gracefully yesterday: supervise/syslog-ng[31237]: Daemon exited gracefully It is my error-script related thing, because this happens when some other error happens too. Its strange with that script. The first instance appears to be started along with syslog-ng: root 26920 26919 0 Dec11 ? 00:00:00 /bin/bash /opt/scripts-system/crashmail But there are another two instances, which somehow origin from the first... root 24423 26920 0 12:30 ? 00:00:00 /bin/bash /opt/scripts-system/crashmail root 24427 24423 0 12:30 ? 00:00:00 /bin/bash /opt/scripts-system/crashmail Lets just say, I don't understand this. Is it fifo or sendmail usage to blame, no idea this far.
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
On Wednesday 16 December 2009 19:16:06 Lance Laursen wrote:
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? I confess: made an extremely silly mistake and this problem is most likely resolved right now. To Balazs Scheidler: I cross off that confirmation, it was false! Sorry for trouble...
participants (6)
-
Balazs Scheidler
-
Fegan, Joe
-
Kārlis Repsons
-
Lance Laursen
-
Siem Korteweg
-
SZALAY Attila