LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2018, 05:33 AM   #1
ekstrah
LQ Newbie
 
Registered: Nov 2018
Posts: 6

Rep: Reputation: Disabled
Bootup Log gathering


Hello, it's my first time writing this question.

I am currently trying to gather all the logs that are generated by each process during the boot up including the application/program.

my .so file only includes fopen function since I assumed that writing the logs will require using fopen function. (https://gist.github.com/ekstrah/4185...a13f720d698fd5 for more details)

I thought about using LD_PRELOAD by writing export LD_PRELOAD in /etc/profile and also tried making ld.so.preload. This was helpful after the bootup. It didn't really gather information that I needed during the bootup time.

So, I want to ask you guys is there a way of gathering logs that are generated during the boot up time?
 
Old 11-11-2018, 05:50 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
why don't you using existing functionality of your init system?
or is the idea to program something from scratch?
 
Old 11-11-2018, 05:59 AM   #3
ekstrah
LQ Newbie
 
Registered: Nov 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
why don't you using existing functionality of your init system?
Can you elaborate and explain in more details? How would you approach this problem?

Thank you very much
 
Old 11-11-2018, 06:06 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
well it depends on the distro, so i suggest you give us some more detail first.

Thank you very much
 
Old 11-11-2018, 06:08 AM   #5
ekstrah
LQ Newbie
 
Registered: Nov 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
well it depends on the distro, so I suggest you give us some more detail first.
I am currently, using "Linux test2 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux"
Is there any information that I need to provide?

and Thank you very much
 
Old 11-11-2018, 06:10 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i think that's Ubuntu 16.04, so it should be using systemd.
Code:
journalctl -b
there's also
Code:
dmesg
which is init-system independent i think.
 
Old 11-11-2018, 06:14 AM   #7
ekstrah
LQ Newbie
 
Registered: Nov 2018
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
i think that's Ubuntu 16.04, so it should be using systemd.
Code:
journalctl -b
there's also
Code:
dmesg
which is init-system independent i think.
It gives out a lot of information about kernel ring buffer, but it doesn't really show which process is writing which logs during the bootup process
 
Old 11-11-2018, 09:44 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
oh, journalctl can do more than dmesg.
Code:
man journalctl
you should read up on your init system, which is systemd as i mentioned earlier.
 
Old 11-11-2018, 10:05 AM   #9
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Have a look in the /var/log/ folder.

Also, while it depends on the syslog implmentation your distribution is using (I don't know what it is on Ubuntu - I haven't checked), if you have a look in the /etc/rsyslog.conf file and scroll down, you should see something like below;

Code:
#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 :omusrmsg:*

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
And yes, dmesg should be independent of the init system, and in any distribution I've ever used, it's been there. So ondoho is quite correct AFAIK.
 
  


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
Scripting mount, log gathering, verifying and unmounting BlackCrowe Linux - Newbie 2 09-21-2010 06:22 AM
new to openbsd - unable to log in on first bootup shawn1 *BSD 2 01-17-2010 10:34 PM
Is there a log for all the bootup messages? Akhran Linux - Newbie 3 11-20-2005 08:43 PM
bootup screen log? Red Squirrel Linux - Software 6 05-14-2005 04:59 PM
Bootup log file? N_A_J_M Linux - General 2 08-26-2002 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09: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