<div dir="ltr">With a lot of help from unix flavored co-workers I got this issue solved!<br>In short the problem was doubled:<br><br>Fist the way I configured the template of the syslog messages included characters that the bash shell interperted them as a signal to close the input stream. Secondly the bash script was creating the classpath relatively to where the script resides.<br>
But syslog-ng runs the script from where ever syslog-ng is, which resulted in the classpath being in-valid or just plain worthless.<br><br>So to solve this I have modified the script to use exec to call java, this way the input stream is not going through the bash shell, or at least that's how it was explained to me.<br>
<br>After this was done the program was still terminating, but this time on its own, because the main class was not found int he class path.<br>So I modified the script again and added a prefix to the classpath relative elementes - with a full path to where the script resides.<br>
<br>And now it all works.<br><br>Thanks for all the strace information it really helped a LOT to pinpoint where the problem is.<br><br><div class="gmail_quote">On Thu, Aug 28, 2008 at 3:01 AM, Balazs Scheidler <span dir="ltr"><<a href="mailto:bazsi@balabit.hu">bazsi@balabit.hu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">On Wed, 2008-08-27 at 16:07 -0500, midnight codder wrote:<br>
> I realized strace is a unix command and not an option of syslog-ng.<br>
> Sorry about that.<br>
><br>
> After running syslog-ng with strace I found out, what was already<br>
> known - syslog-ng is trying to write to the destination program but<br>
> getting a broken pipe error:<br>
><br>
> This is from the output of strace:<br>
><br>
> 598 write(13, "<pri=43> <date=2008-08-27T15:54:"..., 155) = -1 EPIPE<br>
> (Broken pipe)<br>
> 598 --- SIGPIPE (Broken pipe) @ 0 (0) ---<br>
> 598 kill(600, SIGTERM) = 0<br>
><br>
><br>
> And this is from the catch-all destination file:<br>
> <pri=46> <date=2008-08-27T15:54:35.092-05:00> <host=oracle-test><br>
> <msg=syslog-ng[596]: Starting destination program;<br>
> cmdline='bash /usr/local/bds/logger/syslogAdapterProgram.sh'><br>
> <pri=45> <date=2008-08-27T15:54:35.101-05:00> <host=oracle-test><br>
> <msg=syslog-ng[598]: syslog-ng starting up; version='2.1.11a'><br>
> <pri=46> <date=2008-08-27T15:54:35.102-05:00> <host=oracle-test><br>
> <msg=syslog-ng[598]: Initializing destination file writer;<br>
> template='/var/log/syslog-ng-catch-all.log',<br>
> filename='/var/log/syslog-ng-catch-all.log'><br>
> <pri=43> <date=2008-08-27T15:54:35.174-05:00> <host=oracle-test><br>
> <msg=syslog-ng[598]: I/O error occurred while writing; fd='11',<br>
> error='Broken pipe (32)'><br>
> <pri=46> <date=2008-08-27T15:54:35.174-05:00> <host=oracle-test><br>
> <msg=syslog-ng[598]: Sending child a TERM signal; child_pid='597'><br>
><br>
><br>
> I guess my question is: are there any configuration options I was over<br>
> looking, that may resolve this? Or am I not using the Scanner the<br>
> right way? what can cause a broken IO pipe?<br>
<br>
</div></div>Broken pipe is caused by either your application closing its stdin, or<br>
exiting prematurely.<br>
<br>
You can also use strace on your java program to see what happens.<br>
<br>
e.g. use strace in the program() destination like this:<br>
<br>
strace -o /tmp/strace.out -f -s 256 java -cp $CLASSPATH /path/to/java/file<br>
<br>
Then look at strace.out and see what it does with its file descriptor 0<br>
(which is stdin)<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="Wj3C7c">Bazsi<br>
<br>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.campin.net/syslog-ng/faq.html" target="_blank">http://www.campin.net/syslog-ng/faq.html</a><br>
<br>
</div></div></blockquote></div><br></div>