LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-10-2019, 01:06 PM   #1
Lefevre
LQ Newbie
 
Registered: Dec 2019
Posts: 8

Rep: Reputation: Disabled
kern.log is now always empty


Hello,
I just do an upgrade of my debian server from Jessie to Stretch.
But I totaly forgotten to do it in a init S status.
It seems that there was no big issue during the update but I can see now that my kern.log is now always empty. If I do "logger -p kern.info "kern.info: test" for example, it is not written into kern.log.
I'm not familiar with syslog-ng and did'nt find any document that explain how it works and how to debug.
Is there anybody that could help me on this?


# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.11 (stretch)
Release: 9.11
Codename: stretch

# ps -ef | grep syslog
root 24768 1 0 19:21 ? 00:00:00 /usr/sbin/syslog-ng -F --no-caps
 
Old 12-10-2019, 02:21 PM   #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
What information are you looking for?
I'd search the journal; for this boot:
Code:
journalctl -b
or dmesg:
Code:
dmesg
 
Old 12-10-2019, 04:19 PM   #3
Lefevre
LQ Newbie
 
Registered: Dec 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for your reply ondoho.
I just would like to understand how syslog-ng works as there is no more logs written.
I suppose I broken something somewhere so I compared config files before/after but found nothing that could explain my issue.
I understood that syslog-ng is in charge to write kern.log, mail.log and others using some filter rules from system messages (syslog file ?)
I uninstalled syslog-ng (apt-get remove) and re-installed it (apt-get install) but kern.log is still empty.

Thanks anyway for journalctl command I don't know well. It shows some errors that I have to fix before all. Just to find the concerned conf file :-)
This is a first step for debug !

journalctl -b | grep syslog give:
Quote:
déc. 10 19:21:19 vps171520 systemd[1]: syslog-ng.service: Failed to set invocation ID on control group /system.slice/syslog-ng.service, ignoring: Operation not permitted
déc. 10 19:21:19 vps171520 syslog-ng[24768]: [2019-12-10T19:21:19.660636] WARNING: Default value changed for the prefix() option of systemd-journal source in syslog-ng 3.8; old_value='', new_value='.journald.'
déc. 10 19:21:39 vps171520 systemd[1]: [/lib/systemd/system/syslog-ng.service:1] Assignment outside of section. Ignoring.
déc. 10 19:21:39 vps171520 systemd[1]: syslog-ng.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
déc. 10 19:21:47 vps171520 systemd[1]: [/lib/systemd/system/syslog-ng.service:1] Missing '='.
déc. 10 19:24:43 vps171520 systemd[1]: [/lib/systemd/system/syslog-ng.service:1] Assignment outside of section. Ignoring.
déc. 10 19:24:43 vps171520 systemd[1]: syslog-ng.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
déc. 10 19:24:43 vps171520 systemd[1]: [/lib/systemd/system/syslog-ng.service:1] Assignment outside of section. Ignoring.
déc. 10 19:24:43 vps171520 systemd[1]: syslog-ng.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
déc. 10 19:24:43 vps171520 systemd[1]: [/lib/systemd/system/syslog-ng.service:1] Assignment outside of section. Ignoring.
déc. 10 19:24:43 vps171520 systemd[1]: syslog-ng.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
déc. 10 19:24:43 vps171520 systemd[1]: [/lib/systemd/system/syslog-ng.service:1] Assignment outside of section. Ignoring.
déc. 10 19:24:43 vps171520 systemd[1]: syslog-ng.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

Last edited by Lefevre; 12-10-2019 at 04:21 PM. Reason: remove system name
 
Old 12-11-2019, 01:36 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
Quote:
Originally Posted by Lefevre View Post
Just to find the concerned conf file :-)
The output is telling you:
/lib/systemd/system/syslog-ng.service
(BTW, please use CODE tags for code, not QUOTE tags)

My question still stands: What information do you require from kern.log etc.? Is this info not found in the systemd journal?

PS:
I still use stretch on one machine. /var/log/kern.log does exist (and apparently ufw is the only application still using it). Syslog-ng is not installed, but rsyslog is.

Last edited by ondoho; 12-11-2019 at 01:40 AM.
 
Old 12-11-2019, 02:46 AM   #5
Lefevre
LQ Newbie
 
Registered: Dec 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
I mainly use it to get what comes from iptables. For example:
Code:
Dec  7 22:50:56 vps171520 kernel: [30191954.877696] VPSFW SSH DROP: IN=venet0 OUT= MAC= SRC=51.91.136.174 DST=176.31.171.214 LEN=40 TOS=0x00 PREC=0x00 TTL=244 ID=46069 PROTO=TCP SPT=55312 DPT=22 WINDOW=1024 RES=0x00 SYN URGP=0
Thanks for the file name. I was looking for the syslog config files as I never did any change into libs directories.

There, something is strange and very probably bad. I have:

Code:
# ls -ali /etc/systemd/system/multi-user.target.wants/syslog-ng.service
lrwxrwxrwx 1 root root 37 févr.  4  2016 /etc/systemd/system/multi-user.target.wants/syslog-ng.service -> /lib/systemd/system/syslog-ng.service

# ls -ali /lib/systemd/system/syslog-ng.service
281515 -rw-r--r-- 1 root root 149 déc.  10 08:45 /lib/systemd/system/syslog-ng.service

# view /lib/systemd/system/syslog-ng.service
lrwxrwxrwx 1 root root 37 févr.  4  2016 /etc/systemd/system/multi-user.target.wants/syslog-ng.service -> /lib/systemd/system/syslog-ng.service
The file contains a line showing a link like ls do!
The 10th of december is the date where I updated my debian so something goes wrong while the update process was running.

I tried to do a comparison with my system @home. It doesn't use syslog-ng but mine was installed for a long time and followed regular updates.
I suppose ng was not used when I installed my debian.
The server where I get my trouble was first installed with Debian7 by my service provider (OVH). I updated it to debian 8 without issue.
I think syslog-ng was already there.

I wonder if I shouldn't do a total remove of syslog-ng (with config files) and reinstall it.
What do you fell?

NB: Ok for code tag instead of quote. This tag is not displayed to me, so I'm going to use it "by hand" ;-)
 
Old 12-11-2019, 03:37 AM   #6
Lefevre
LQ Newbie
 
Registered: Dec 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
I re-installed syslog-ng.core
Code:
# apt --reinstall install syslog-ng.core
...
Préparation du dépaquetage de .../syslog-ng-core_3.8.1-10_amd64.deb ...
Dépaquetage de syslog-ng-core (3.8.1-10) sur (3.8.1-10) ...
Paramétrage de syslog-ng-core (3.8.1-10) ...
Traitement des actions différées («*triggers*») pour systemd (232-25+deb9u12)*...
Traitement des actions différées («*triggers*») pour man-db (2.7.6.1-2)*...
so now I have:

Code:
# cat /lib/systemd/system/syslog-ng.service
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)

[Service]
Type=notify
ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS
ExecReload=/bin/kill -HUP $MAINPID
EnvironmentFile=-/etc/default/syslog-ng
EnvironmentFile=-/etc/sysconfig/syslog-ng
StandardOutput=journal
StandardError=journal
Restart=on-failure

[Install]
WantedBy=multi-user.target

Last edited by Lefevre; 12-11-2019 at 03:38 AM. Reason: bad tags
 
Old 12-12-2019, 05:24 PM   #7
Lefevre
LQ Newbie
 
Registered: Dec 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
Ok, I was not able to find were is the problem as I don't really know how all these logs are managed.
As it was important and urgent for me to fix that issue, I totaly remove syslog-ng and installed rsyslog (which is installed by default on my own server @ home with the same debian release) and now it works.
So, I probably never know what was broken ... and I don't like this very much.
Many thanks anyway for your kind assistance.

Last edited by Lefevre; 12-12-2019 at 05:25 PM. Reason: typo
 
Old 12-13-2019, 12:55 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
Quote:
Originally Posted by Lefevre View Post
I probably never know what was broken ... and I don't like this very much.
You yourself found what is broken:
Quote:
Originally Posted by Lefevre View Post
Code:
# view /lib/systemd/system/syslog-ng.service
lrwxrwxrwx 1 root root 37 févr.  4  2016 /etc/systemd/system/multi-user.target.wants/syslog-ng.service -> /lib/systemd/system/syslog-ng.service
The file contains a line showing a link like ls do!
It could be that you did this (inadvertently), or that it indeed happened during an update.
Considering how long this system has been running, and how many upgrades it has seen, I would say it's machine-specific, and not something to report to the maintainers.
 
Old 12-13-2019, 01:22 AM   #9
Lefevre
LQ Newbie
 
Registered: Dec 2019
Posts: 8

Original Poster
Rep: Reputation: Disabled
Well, you helped me showing the command journalctl -b.
I don't use it often as I'm used too use vi and logs (too old school) and I now have to explore it more deeply.

In fact, I think the things are not so simple.
When I changed that broken file with a good one (extract from official Debian package) syslog-ng was still not running.
I checked other dependant syslog-ng packages but even after reload configs and even a server reboot, kern.log was desperately empty.

In my undestanding kern.log is written by syslog-ng (or rsyslog) after reading /proc/kmsg and filter to dispatch.
So I suppose that the process (?) to read /proc/kmsg was broken for any reason. Install rsyslog fixed it.
I don't want to test it now as it is a live server and all seems to me ok now, but I'm pretty sure, if I would reinstall syslog-ng, it would work.

Thanks again for your time ondoho.

Last edited by Lefevre; 12-13-2019 at 01:23 AM. Reason: typo
 
  


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
kernel log format in /var/log/kern.log sinu_nayak2001 Linux - Newbie 2 10-07-2009 08:34 AM
kern.log remains empty - where to start troubleshooting? eentonig Linux - Software 4 03-10-2009 08:38 AM
Empty kern.log--Debian lenny addux Linux - Software 2 02-23-2009 12:53 AM
is it possible that hardware support decreased from kern 2.4 to 2.6? (and other kern servnov Linux - Newbie 3 11-11-2004 04:59 PM
/var/log/kern.log message dimkal Linux - Hardware 1 05-08-2004 06:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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