LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-18-2021, 05:38 AM   #1
linuly
Member
 
Registered: Jan 2018
Posts: 96

Rep: Reputation: Disabled
journal


hi,
i like to see if i understood.
rsyslogd write in /var/log/messages,/var/log/secure so on and systemd-journald write in /var/log/journal if Storage=persistent.

somehow systemd-journald uses rsyslogd to write in /var/log/messages?
Feb 18 06:35:34 Razan1 systemd: Starting The Apache HTTP Server...

in /var/log/journal i can have more data as in /var/log/messages.corect?
 
Old 02-18-2021, 05:49 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,588
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
I think the way it works is that journald makes available a socket, and syslogd and klogd can take their messages from there. They run as independent daemons; journald doesn't run them.

The journal contains the same information as /var/log/messages, but it also contains a lot of meta-information that allows the journalctl program to identify entries and print them out selectively on command. So, for example, you can look at the messages relevant to a particular service that is giving trouble, without having to scroll through a lot of other bumf. The price you pay of course is that the journal is a binary file and you can't inspect it with the usual text tools, only with journalctl.
 
Old 02-18-2021, 06:22 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
hazel's explanation is correct, but RHEL and friends have a different approach. They read from the journal file directly, using a special rsyslogd module. The statement "only journalctl can read the journal" is, therefore, not quite correct.
 
1 members found this post helpful.
Old 02-18-2021, 06:28 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,588
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
Wow! You learn something every day.
 
Old 02-19-2021, 03:59 AM   #5
linuly
Member
 
Registered: Jan 2018
Posts: 96

Original Poster
Rep: Reputation: Disabled
i see that all the messages logged by rsyslogd,crond, so on are written centralized by systemd-journald.

ex.
Code:
Feb 19 04:40:01 Razan1 CROND[17405]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb 19 04:48:17 Razan1 polkitd[755]: Registered Authentication Agent for unix-process:17481:8648658 (system bus name :1.422 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Feb 19 04:48:17 Razan1 polkitd[755]: Unregistered Authentication Agent for unix-process:17481:8648658 (system bus name :1.422, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Feb 19 04:48:21 Razan1 polkitd[755]: Registered Authentication Agent for unix-process:17491:8649040 (system bus name :1.423 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Feb 19 04:48:21 Razan1 polkitd[755]: Unregistered Authentication Agent for unix-process:17491:8649040 (system bus name :1.423, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Feb 19 04:48:27 Razan1 polkitd[755]: Registered Authentication Agent for unix-process:17509:8649639 (system bus name :1.424 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Feb 19 04:48:27 Razan1 chronyd[747]: chronyd exiting
Feb 19 04:48:27 Razan1 systemd[1]: Stopping NTP client/server...
Feb 19 04:48:27 Razan1 systemd[1]: Stopped NTP client/server.
Feb 19 04:48:27 Razan1 polkitd[755]: Unregistered Authentication Agent for unix-process:17509:8649639 (system bus name :1.424, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Feb 19 04:50:01 Razan1 systemd[1]: Started Session 174 of user root.
Feb 19 04:50:01 Razan1 CROND[17536]: (root) CMD (/usr/lib64/sa/sa1 1 1)
then everything from above without crond and polkitd is logged in messages and crond log in cron.

logger use rsyslogd to lo in messages.rsyslogd does not use logger to log in messages.correct?

Last edited by linuly; 02-19-2021 at 04:20 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to keep only one Systemd Journal log in /run/log/journal jegadezz Linux - Software 3 07-27-2016 06:24 AM
How to keep only one Systemd Journal log in /run/log/journal jegadezz Linux - Kernel 1 07-25-2016 01:00 PM
LXer: March 2014 Issue of Linux Journal: 20 Years of Linux Journal LXer Syndicated Linux News 0 03-04-2014 11:21 PM
journal rollforward failed: journal out of sync with zone-No DDNS plvasco Linux - Server 0 05-31-2013 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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