NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/59455: Syslog silently discards log messaages if /var/log/messages is missing



>Number:         59455
>Category:       bin
>Synopsis:       Syslog silently discards log messaages if /var/log/messages is missing
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 02 20:30:01 +0000 2025
>Originator:     Aaron
>Release:        NetBSD 9.1/amd64
>Organization:
>Environment:
NetBSD obscene 9.1 NetBSD 9.1 (GENERIC) #0: Sun Oct 18 19:24:30 UTC 2020  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
I noticed ( in May 2025 ) logging to /var/log/messages on a machine had stopped on Dec 5th 2024.

Ultimately the cause is that /var/log/messages was missing. I had expected syslogd would automatically create log files as needed.

>How-To-Repeat:
Remove /var/log/messages and restart syslogd with -d, output is:

Running 'syslogd -d' I was able to see:

2025-06-02T15:58:25.950700-04:00:/usr/src/usr.sbin/syslogd/syslogd.c:read_config_file:3169      read_config_file()
2025-06-02T15:58:25.951693-04:00:/usr/src/usr.sbin/syslogd/syslogd.c:cfline:3736        cfline(4, "*.info;auth,authpriv,cron,ftp,kern,lpr,mail.none     /var/log/messages", f, "*", "*")
2025-06-02T15:58:25.953829-04:00:/usr/src/usr.sbin/syslogd/syslogd.c:logerror:2882      /var/log/messages: No such file or directory

Syslog starts and operats normally, but silently discards output that should go to /var/log/messages. 

>Fix:
'touch /var/log/messages' and '/etc/rc.d/syslogd restart' fixed the issue this time.

I think syslogd should automatically create log files at startup/reload as necessary.

If there are valid reasons this cannot be done, at least provide some signal to the administrator that there is a problem. For example, outputting "/var/log/messages: No such file or directory" before syslog daemonizes would at least greatly reduce time to troubleshoot.



Home | Main Index | Thread Index | Old Index