----- Original Message -----
> From: "Jan Stancek" <jstan...@redhat.com>
> To: chru...@suse.cz
> Cc: ltp-list@lists.sourceforge.net
> Sent: Thursday, 14 August, 2014 4:23:06 PM
> Subject: Re: [LTP] [PATCH] syslog-lib: add SystemLogSocketName to rsyslog.conf
> 
> 
> 
> 
> 
> ----- Original Message -----
> > From: chru...@suse.cz
> > To: "Jan Stancek" <jstan...@redhat.com>
> > Cc: ltp-list@lists.sourceforge.net
> > Sent: Thursday, 14 August, 2014 3:54:22 PM
> > Subject: Re: [LTP] [PATCH] syslog-lib: add SystemLogSocketName to
> > rsyslog.conf
> > 
> > Hi!
> > > If this parameter is ommitted, rsyslog will use default,
> > > which is /dev/log. After rsyslog stop/restart, this node gets
> > > deleted. This breaks further syslog() calls on distros
> > > using systemd-journald when test performs cleanup, because
> > > rsyslog doesn't re-create /dev/log. Default distro rsyslog
> > > config is "/run/systemd/journal/syslog", so system ends
> > > up with missing /dev/log.
> > > 
> > > For example:
> > >   cp -f /etc/rsyslog.conf /etc/rsyslog.conf.backup
> > >   echo '$ModLoad imuxsock.so'  > /etc/rsyslog.conf
> > >   echo "*.crit            /var/log/messages"  >> /etc/rsyslog.conf
> > >   systemctl restart rsyslog
> > >   cp /etc/rsyslog.conf.backup /etc/rsyslog.conf
> > >   systemctl restart rsyslog # --> PROBLEM: /dev/log is now gone
> > > 
> > > This patch will include "$SystemLogSocketName" line from
> > > rsyslog configuration to rsyslog.conf defined by syslog* tests.
> > 
> > I've read this twice and I'm still unsure what happens.
> > 
> > My guess is that on new enough RedHat all logging goes through systemd
> > and the rsyslog configuration contains explicit option to create
> > /dev/log for compatibility reasons? But if that is the problem why is
> > the /dev/log missing after the configuration was restored and rsyslog
> > restarted?
> 
> /dev/log is created by systemd-journald. Distro rsyslog config is setup
> to use /run/systemd/journal/syslog. When rsyslog is stopped/restarted
> it deletes whatever socket was configured.
> 
> This testcase doesn't configure any log socket explicitly in rsyslog
> config. So rsyslog will use default, which is "/dev/log". Now
> when you stop/restart rsyslog it deletes /dev/log and all applications
> which use syslog(2) now fail to log anything.

To clarify: logging this way works during the test. After test,
when configuration is restored, rsyslog re-creates /run/systemd/journal/syslog,
but noone re-creates /dev/log. In other words: /dev/log owned by journald
is removed by rsyslog config used in this test.

Regards,
Jan

> 
> I think the way it works is that journald reads message from /dev/log
> and for compatibility reasons it forwards it to /run/systemd/journal/syslog
> where rsyslog can read and process it.
> 
> Regards,
> Jan
> 
> > 
> > --
> > Cyril Hrubis
> > chru...@suse.cz
> > 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to