Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

At my office I recently wondered aloud to all, "Why shouldn't these logs be redirected to /dev/null instead of /dev/lognull?" I was told that there is (or was) a reason, but no one could remember it. I was told that the reasons is in the syslog-ng documentation somewhere, but so far I haven't been able to find it. Does anybody know the reason?

share|improve this question
1  
Watching this one because I've never heard of lognull. –  phoebus Dec 3 '09 at 2:38

2 Answers 2

up vote 2 down vote accepted

I was just emailed this from my boss:

Well, we named it lognull, but that was just our choice. I found the reason again. Syslog-ng wants to change the permissions on the file it uses for logging, including /dev/null. Lots of other things in the system (incl. things not running as root) depend on /dev/null being readable and writable. That's why you're supposed to use a separate device file:

odin ~ # ls -ld /dev/null crw------- 1 root root 1, 3 Sep 30 15:48 /dev/null

Maybe the easiest thing would be for the init script for syslog-ng to create something like /dev/lognull so it's always available for the system. I think the problem is that it goes away after a reboot because of the dynamic nature of devices now. That wasn't the case when we ran all this on older versions of Linux or on Solaris. Does this make sense?

And I also found this thread on the syslog-ng list about the issue. So far I've followed the advice about an empty destination.

share|improve this answer
    
Please mark this as the correct answer to the question. –  pauska Dec 3 '09 at 15:25

I have never heard of /dev/lognull.

What does this return?

ls -l /dev/null /dev/lognull

I suppose it's possible syslog-ng is creating that device node, but man, seems very strange.

I have to admit I'd find it pretty entertaining if /dev/lognull were a large regular file. :)

share|improve this answer
    
See that's the problem, when I last remember looking I would swear lognull was a device file, but when I looked more recently it was an enormous regular file and it was causing problems. –  thepocketwade Dec 3 '09 at 3:48
2  
I have no idea what it would do that is different than /dev/null, and searching for /dev/lognull through various engines returns only this question. I think perhaps you need more or less coffee. :) –  Michael Graff Dec 3 '09 at 8:28

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.