Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] syslog-ng + automatic respawn of target programs
Date: Wed, 05 Jul 2006 16:13:18
Message-Id: 7573e9640607050903y67171685r5feb7fbfc0835e4f@mail.gmail.com
In Reply to: Re: [gentoo-user] syslog-ng + automatic respawn of target programs by thomas blomme
1 On 7/4/06, thomas blomme <blommethomas@×××××.com> wrote:
2 >
3 > http://www.campin.net/syslog-ng/expanded-syslog-ng.conf
4 >
5 > look at the above link, it contains all functions syslog can have
6
7 Ok. It is also in the documentation installed at
8 /usr/share/doc/syslog-ng-*/html/. So I guess it is just an omission
9 from the man page.
10
11 Back to the OP's question, the syslog documentation seems to make it
12 clear that it will not respawn the program to prevent DoS attacks. If
13 you want this, you can create a shell script around the program you
14 want to call, and handle any respawns there. A simple implementation
15 might be:
16
17 $program &
18 pid=$!
19 while wait $pid; do
20 $program &
21 pid=$!
22 done
23
24 Of course, it would be best to add in some type of abort mechanism in
25 case $program starts dying unexpectedly, so you don't try to exec it
26 1000's of times per second.
27
28 -Richard
29 --
30 gentoo-user@g.o mailing list