Re: /dev/stderr gets unlinked 8]

linux-os (Dick Johnson)
2006-03-17T15:40:30Z

On Fri, 17 Mar 2006, Jan Engelhardt wrote:

>>>>> any good daemon closes stdout, stderr, stdin
>>>>
>>>> A real good daemon would redirect them to /dev/null.
>>>
>>> and writes to /var/log/mysql/...
>>
>> And has log rotation. Apache has log rotation. Squid has log rotation.
>>
>> Why they all need to have log rotation code? I forced them all to just
>
> I dunno. SUSE Linux (no advertisement intended) uses a global solution -
> "logrotate" rather than using each project's own logrotation.
>
>> write log to stderr, and multilog from daemontools does the logging
>> (with rotation and postprocessing (for example, feeds Squid log into
>> Mysql db)) just fine.
>>
>> But we digress. Is there any magic (mount --bind?) to make
>> /dev/stderr undestructible?
>
> If not, you could write an LSM that prohibits unlinking /dev/stderr.
>
> Jan Engelhardt

That symlink isn't even used -- at least by any sane program!
I don't have a clue why these things were created and what they
were for. The objects stdin, stdout, and stderr, are 'C' runtime
library pointers to opaque types associated with the file descriptors,
STDIN_FILENO, STDOUT_FILENO, and STDERR_FILENO. The presence of
these bogus sym-links in /dev represent some kind of obfuscation
and have no value except to confuse (or identify a RedHat distribution).

Cheers,
Dick Johnson
Penguin : Linux version 2.6.15.4 on an i686 machine (5589.54 BogoMips).
Warning : 98.36% of all statistics are fiction, book release in April.
_
\x1a\x04

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.