syslog messages during boot not recorded?
Hi all,
I'm using buildroot v10.11 on an embedded system running Linux kernel 2.6.32.2.
I installed some daemons wrote by me which are started at boot time by some /etc/init.d scripts of mine. These daemons use many syslog() to provide verbose debugging messages... however, for some reason, when I boot the system and cat /var/log/messages, I do not see any message.
If I start manually the daemons, the messages are correctly logged to /var/log/messages...
I think that this problem maybe because syslogd is startd AFTER all /etc/init.d scripts have been processed.. is that right?
I tried to comment the lines:
null::respawn:/sbin/syslogd -n -m 0
null::respawn:/sbin/klogd -n
contained in /etc/inittab and then to add the S01logging script found in this patch:
http://lists.busybox.net/pipermail/buildroot/2011-July/043828.html
but I obtained the same results... (of course my etc scripts start with S90, S91, etc, so they should run AFTER S01logging...)
Thanks for any hint!
Francesco
Quoted 9 lines · Francesco Montorsi
I installed some daemons wrote by me which are started at boot time by some
/etc/init.dscripts of mine. These daemons use manysyslog()to provide verbose debugging messages... however, for some reason, when I boot the system and cat/var/log/messages, I do not see any message.
If I start manually the daemons, the messages are correctly logged to/var/log/messages...I think that this problem maybe because syslogd is startd AFTER all
/etc/init.dscripts have been processed.. is that right?
Hi.
Or maybe your busybox is configured to use the circular buffer (in RAM) for logs (CONFIG_FEATURE_IPC_SYSLOG)... and you should just read your logs with "logread"...
Regards.
Hi,
2013/4/8 Gustavo Zacarias <[email protected]>:
Quoted 3 lines
Or maybe your busybox is configured to use the circular buffer (in RAM) for logs (
CONFIG_FEATURE_IPC_SYSLOG)... and you should just read your logs with "logread"...
well, my buildroot is not the latest version... I'm using version 10.11 and I cannot see anything similar to IPC_SYSLOG in its .config... maybe this is a feature of newer buildroots?
Thanks!
FM
Quoted 6 lines · Francesco
well, my buildroot is not the latest version... I'm using version 10.11 and I cannot see anything similar to
IPC_SYSLOGin its .config... maybe this is a feature of newer buildroots?Thanks!
FM
It's a feature of BUSYBOX, not buildroot, meant for syslogd to work in scenarios where your /var/log directory isn't writable for example. Which begs the question, is it writable?
Regards.
2013/4/8 Gustavo Zacarias <[email protected]>:
Quoted 3 lines
It's a feature of BUSYBOX, not buildroot, meant for syslogd to work in scenarios where your
/var/logdirectory isn't writable for example. Which begs the question, is it writable?
good point... my /var/log is a symbolic link to /tmp and "ls -l" shows that its permissions (after system boot) are "drwxrwxrwt". I think the problem may be due to /tmp being mounted AFTER/AT THE END of the system boot... in fact, /tmp is a tmpfs... the relevant line in /etc/fstab is:
tmpfs /tmp tmpfs defaults 0 0
now my question is: how do I ensure that /tmp is mounted before /etc/init.d scripts are run?
Thanks a lot!
Francesco
In any case, something I do not understand is the reason why /var/log/messages contains a lot of messages marked as "kernel: " and referring to the boot of the system (hardware configuration, CPU features, etc etc etc)... these messages are probably generated much earlier than /etc/init.d scripts are run!
Thanks for any hint,
Francesco
2013/4/9 Francesco <[email protected]>:
Quoted 17 lines
2013/4/8 Gustavo Zacarias <[email protected]>:
Quoted 3 lines
It's a feature of BUSYBOX, not buildroot, meant for syslogd to work in scenarios where your
/var/logdirectory isn't writable for example. Which begs the question, is it writable?good point... my
/var/logis a symbolic link to /tmp and "ls -l" shows that its permissions (after system boot) are "drwxrwxrwt". I think the problem may be due to /tmp being mounted AFTER/AT THE END of the system boot... in fact, /tmp is a tmpfs... the relevant line in/etc/fstabis:tmpfs /tmp tmpfs defaults 0 0
now my question is: how do I ensure that /tmp is mounted before
/etc/init.dscripts are run?Thanks a lot!
Francesco
A few more results from my investigations: the absence of logged messages does not depend from the values of the facility/level options passed to openlog() or syslog() (apparently).
Moreover, a process started at boot time and doing periodic syslog() calls, will generate output in /var/log/messages at some point, but all its initial syslog() messages are lost.
At this point, I will write a syslog() wrapper to log to a file the messages I need, rather than rely on a working syslog() during boot :(
Francesco