LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-08-2019, 07:11 AM   #1
Sentih
LQ Newbie
 
Registered: Oct 2018
Distribution: Ubuntu, Arch Linux
Posts: 19

Rep: Reputation: Disabled
Kernel does not store logs


No logs are to be found /var/log. I am building custom OS and something keeps going wrong. I should be able to fix problem myself, but I need to know what caused the problem. I have about second to read error messages. Then system is down. Any ideas?
 
Old 05-08-2019, 07:19 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,154

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Start by reading this - zero info means zero assistance. Simple as that.
 
Old 05-08-2019, 07:58 AM   #3
Sentih
LQ Newbie
 
Registered: Oct 2018
Distribution: Ubuntu, Arch Linux
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Start by reading this - zero info means zero assistance. Simple as that.
All right. Is there a way to capture output of kernel and/or runit (process #1) during boot? Runit fails and shuts system down. Information I need is being printed on screen for fraction of second and I would like to save it to file.

EDIT:
More detalied description. I decided to create OS using Linux-libre kernel for educational purposes.
  • I compiled the kernel and modules
  • I compiled glibc and installed it
  • I compiled and installed coreutils
  • I compiled and installed runit
  • I installed some basic programs from util-linux
  • I chose dash as my shell
As stated above runit doesn't work and I don't expect you to fix it. I must have made a mistake and I want to fix it. I please you to help me to read error messages. They appear on my screen for really short time so I can't read them. I need to freeze screen or log output of kernel and/or runit. How do I achieve this? Directory /var/log is empty.

Last edited by Sentih; 05-08-2019 at 08:39 AM. Reason: To fix spelling mistake
 
Old 05-08-2019, 12:45 PM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,050

Rep: Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349Reputation: 7349
did you try to mount that root filesystem from another os and check /var/log?
Did you try to look for boot.log on the net?
 
Old 05-08-2019, 03:58 PM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,687
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
The kernel doesn't write logs. syslogd and klogd do. Check your /etc/syslog.conf file. It determines where logged data goes. The one I have on LFS says:
Code:
# Begin /etc/syslog.conf

auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *

# End /etc/syslog.conf

Last edited by hazel; 05-08-2019 at 03:59 PM.
 
Old 05-08-2019, 06:43 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,154

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
If runit is failing, none of the userland daemons will be invoked. Attach a serial console.
 
1 members found this post helpful.
Old 05-09-2019, 01:34 PM   #7
Sentih
LQ Newbie
 
Registered: Oct 2018
Distribution: Ubuntu, Arch Linux
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64
did you try to mount that root filesystem from another os and check /var/log?
Yes, exactly.

Quote:
Originally Posted by hazel
The kernel doesn't write logs.
Definitely not a good news.

Quote:
Originally Posted by syg00 View Post
If runit is failing, none of the userland daemons will be invoked. Attach a serial console.
I don't have one. I don't have any suitable device at all.

I think I have an idea. I may edit runit's code so it will pause before shutdown. But I don't have time today. Yesterday is a day, too.

Last edited by Sentih; 05-09-2019 at 01:35 PM.
 
Old 05-09-2019, 01:49 PM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,687
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
The kernel only writes to its internal message ring. These are the messages you read with the dmesg command. The logs in /var/log are written by the twin daemons installed from the sysklogd package. klogd takes the output off the message ring and stores it in files, while syslogd does the same with output from daemons. If you haven't installed these packages, you won't have any messages except the boot messages at the system console.

If you think about it, the kernel can't write messages to disk because it has to be able to run before any discs are mounted.
 
1 members found this post helpful.
Old 05-10-2019, 02:36 PM   #9
Sentih
LQ Newbie
 
Registered: Oct 2018
Distribution: Ubuntu, Arch Linux
Posts: 19

Original Poster
Rep: Reputation: Disabled
Solved. Runit can't find some scripts even they do exist. I'm going to keep modified version as I may encounter further problems.

I'm thankful you taught me something new.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vSphere / ESXi - Renaming Directory Names in Data-Store and Moving things around in Data-Store devUnix Linux - Virtualization and Cloud 1 04-27-2017 08:13 AM
Back up logs file and create a script showing the backed up logs and the running logs Billy_6052 Programming 5 12-13-2014 02:32 AM
Information store: What software could I use to store and access various info merixon Linux - Software 2 12-17-2008 11:51 AM
[Kopete] Where does it store its logs? Celettu Linux - Software 2 08-25-2004 02:30 PM
'alsactrl store' doesn't seem to store... endfx Slackware 1 08-20-2004 01:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration