Running script for checking syslog-ng status
Hi All, Does syslog-ng have a running script that check the syslog-ng running status? If it crashed or stopped running,this script can make sure to start a new syslog-ng process. This morning,the syslog-ng on my server crashed,and somehow resulted in the server halt. Thanks. Best, Henry
"Henry Xu" <xkb.surfing@gmail.com> writes:
Hi All, Does syslog-ng have a running script that check the syslog-ng running status? If it crashed or stopped running,this script can make sure to start a new syslog-ng process. This morning,the syslog-ng on my server crashed,and somehow resulted in the server halt. Thanks.
"syslog-ng-ctl stats" is the closest thing. Apart from that, you can save the PID of syslog-ng to a pidfile, and verify that the PID is still present, and if it belongs to syslog-ng (syslog-ng will by default, save a pidfile, FYI). -- |8]
Gergely Nagy <algernon@balabit.hu> writes:
"Henry Xu" <xkb.surfing@gmail.com> writes:
Hi All, Does syslog-ng have a running script that check the syslog-ng running status? If it crashed or stopped running,this script can make sure to start a new syslog-ng process. This morning,the syslog-ng on my server crashed,and somehow resulted in the server halt. Thanks.
"syslog-ng-ctl stats" is the closest thing. Apart from that, you can save the PID of syslog-ng to a pidfile, and verify that the PID is still present, and if it belongs to syslog-ng (syslog-ng will by default, save a pidfile, FYI).
It was also brought to my attention, that syslog-ng has a built-in supervisor, that will restart it in case it crashes. This can be enabled by starting syslog-ng with the --process-mode=safe-background command-line argument. (What do you know? I never knew this was there! One learns something new every day!) -- |8]
On Thu, May 26, 2011 at 10:49:08AM +0200, Gergely Nagy wrote:
It was also brought to my attention, that syslog-ng has a built-in supervisor, that will restart it in case it crashes. This can be enabled by starting syslog-ng with the --process-mode=safe-background command-line argument.
(What do you know? I never knew this was there! One learns something new every day!)
Gergely, I thought the supervisor was on by default. Am I mistaken to believe this? When I run syslog-ng without that options I always get a "supervising syslog-ng" (the wonders of setproctitle) and a normal one with the launch options. Matthew.
Matthew Hall <mhall@mhcomputing.net> writes:
On Thu, May 26, 2011 at 10:49:08AM +0200, Gergely Nagy wrote:
It was also brought to my attention, that syslog-ng has a built-in supervisor, that will restart it in case it crashes. This can be enabled by starting syslog-ng with the --process-mode=safe-background command-line argument.
(What do you know? I never knew this was there! One learns something new every day!)
Gergely,
I thought the supervisor was on by default. Am I mistaken to believe this?
You are correct. -- |8], who's been running 3.3 in screen with -Fve for the past couple of months.
On May 25, 2011, at 16:19, "Henry Xu" <xkb.surfing@gmail.com> wrote:
Hi All, Does syslog-ng have a running script that check the syslog-ng running status? If it crashed or stopped running,this script can make sure to start a new syslog-ng process. This morning,the syslog-ng on my server crashed,and somehow resulted in the server halt. Thanks.
I've Run it under daemontools to have it auto restart. IIRC monit is a newer option. I'd look at those. Cheers, Bill
participants (4)
-
Bill Anderson
-
Gergely Nagy
-
Henry Xu
-
Matthew Hall