Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using syslog-ng on a Ubuntu Lucid machine with the following upstart script:

# syslog-ng - system logging daemon
#

description     "Syslog-ng daemon"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]

expect fork
respawn

pre-start script
    test -x /usr/sbin/syslog-ng || { stop; exit 0; }
    mkdir -p -m0755 /var/run/syslog-ng
end script

exec /usr/sbin/syslog-ng -p /var/run/syslog-ng/syslog-ng.pid

When the syslog-ng configuration file is wrong, syslog-ng outputs an error message on stderr. Unfortunately, this error is caught by upstart and doesn't get to the console when starting the service, so there is no way to know why the service start failed.

Is it normal that upstart would catch stderr? Can it be set?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

This is documented in init(5); you can add the following line to your /etc/init/syslog-ng.conf to see output:

console output

Alternatively, you can see output from all upstart scripts when you add the following to the kernel boot parameters:

INIT_VERBOSE=yes

You can do that temporarily by editing the parameters in the grub menu during boot, or (more) permanently by editing /etc/default/grub and adding it to GRUB_CMDLINE_LINUX, then afterwards run update-grub.

For more information and best practices, see The Upstart Cookbook.

share|improve this answer
    
Silly me, I was reading man 1 init and not even considering man 5 init. I'll try that tomorrow, it seems like the right answer :-) –  ℝaphink Aug 26 '10 at 21:38
    
I understand adding "console output" sends the console output to /dev/console, but where can I read that from? Is it logged in some file? –  François Beausoleil Apr 12 '11 at 18:40
add comment

If the stdout is getting through what you can do is. which will pipe the stderr to stdout which should solve your problem. :)

syslog-ng 2>&1
share|improve this answer
    
Nope, neither stdout nor stderr get through. Thanks for proposing though. –  ℝaphink Aug 26 '10 at 18:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.