Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] OpenRC, syslog-ng - shutdown is always logged twice
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2614

PostPosted: Tue Jun 20, 2017 8:34 am    Post subject: [Solved] OpenRC, syslog-ng - shutdown is always logged twice Reply with quote

I discovered this on a fresh installation using syslog-ng and then also found it on an older installation.

For every shutdown the log of shutdown looks like:
/var/log/rc.log:
rc shutdown logging started at Sat Jun 17 11:11:03 2017

 * Saving random seed ...
 [ ok ]
 * Stopping DHCP Client Daemon ...
 [ ok ]
 * Unmounting loop devices
 * Unmounting filesystems
 *   Unmounting /var/tmp/portage ...
 [ ok ]
 * Deactivating swap devices ...
 [ ok ]
 * Shutting down the Logical Volume Manager
 *   Shutting Down LVs & VGs ...
  Logical volume vg0/root contains a filesystem in use.
 * Failed (possibly some LVs still needed for /usr or root)
 [ !! ]
 * Finished shutting down the Logical Volume Manager
 * Stopping lvmetad ...
 [ ok ]
 * Stopping udev ...
 [ ok ]

rc shutdown logging stopped at Sat Jun 17 11:11:04 2017


rc shutdown logging started at Sat Jun 17 11:11:03 2017

 * Saving random seed ...
 [ ok ]
 * Stopping DHCP Client Daemon ...
 [ ok ]
 * Unmounting loop devices
 * Unmounting filesystems
 *   Unmounting /var/tmp/portage ...
 [ ok ]
 * Deactivating swap devices ...
 [ ok ]
 * Shutting down the Logical Volume Manager
 *   Shutting Down LVs & VGs ...
  Logical volume vg0/root contains a filesystem in use.
 * Failed (possibly some LVs still needed for /usr or root)
 [ !! ]
 * Finished shutting down the Logical Volume Manager
 * Stopping lvmetad ...
 [ ok ]
 * Stopping udev ...
 [ ok ]

rc shutdown logging stopped at Sat Jun 17 11:11:04 2017
And yes, it is always twice with the same timestamp.

syslog-ng is used with its default configuration:
/etc/syslog-ng/syslog-ng.conf:
@version: 3.7
#
# Syslog-ng default configuration file for Gentoo Linux

# https://bugs.gentoo.org/show_bug.cgi?id=426814
@include "scl.conf"

options {
        threaded(yes);
        chain_hostnames(no);

        # The default action of syslog-ng is to log a STATS line
        # to the file every 10 minutes.  That's pretty ugly after a while.
        # Change it to every 12 hours so you get a nice daily update of
        # how many messages syslog-ng missed (0).
        stats_freq(43200);
        # The default action of syslog-ng is to log a MARK line
        # to the file every 20 minutes.  That's seems high for most
        # people so turn it down to once an hour.  Set it to zero
        # if you don't want the functionality at all.
        mark_freq(3600);
};

source src { system(); internal(); };

destination messages { file("/var/log/messages"); };

# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
# ...if you intend to use /dev/console for programs like xconsole
# you can comment out the destination line above that references /dev/tty12
# and uncomment the line below.
#destination console_all { file("/dev/console"); };

log { source(src); destination(messages); };
log { source(src); destination(console_all); };
/etc/conf.d/syslog-ng:
# Config file for /etc/init.d/syslog-ng

# If you are not using network logging, this entire section should be
# commented out. Otherwise, choose one of the settings below based on
# how you are configuring your network.
#
# If you are using the net.* scripts to configure your network, you should
# set rc_need to match the interface through which your logging server
# can be reached.
#rc_need="net.eth0"
#
# If you are using an interface manager like wicd, dhcpcd in standalone
# mode, networkmanager, etc to control your interfaces, set rc_need to
# the name of that service.
# rc_need="dhcpcd"
#rc_need="networkmanager"
#
# If you are using newnet and configuring your interface statically with
# the network script, you should use this setting.
#rc_need="network"
#
# You can use this setting, but I do not recommend relying on it.
#rc_need="net"
#
# You may also want to uncomment the following if you are using network
# logging.
#rc_use="stunnel"

# For very customized setups these variables can be adjusted as needed
# but for most situations they should remain commented:
# SYSLOG_NG_CONFIGFILE=/etc/syslog-ng/syslog-ng.conf
# SYSLOG_NG_STATEFILE_DIR=/var/lib/syslog-ng
# SYSLOG_NG_STATEFILE=${SYSLOG_NG_STATEFILE_DIR}/syslog-ng.persist
# SYSLOG_NG_PIDFILE_DIR=/run
# SYSLOG_NG_PIDFILE=${SYSLOG_NG_PIDFILE_DIR}/syslog-ng.pid
# SYSLOG_NG_GROUP=root
# SYSLOG_NG_USER=root

# Put any additional options for syslog-ng here.
# See syslog-ng(8) for more information.

SYSLOG_NG_OPTS=""

Could someone help with an idea how to avoid the duplicate output?

Edit: Solved


Last edited by charles17 on Fri Jun 23, 2017 9:30 am; edited 1 time in total
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 260
Location: Milan, IT

PostPosted: Thu Jun 22, 2017 4:14 pm    Post subject: Reply with quote

Hi charles17
AFAIK, OpenRC manages logging by itself.
from my /etc/rc.conf (default) logging is disabled:
Code:
# rc_logger launches a logging daemon to log the entire rc process to
# /var/log/rc.log
# NOTE: Linux systems require the devfs service to be started before
# logging can take place and as such cannot log the sysinit runlevel.
#rc_logger="NO"

# Through rc_log_path you can specify a custom log file.
# The default value is: /var/log/rc.log
#rc_log_path="/var/log/rc.log"


How is yours?
And which version of OpenRC are you using?

Furthermore, that syslog-ng config only writes /var/log/messages and the raw output on /dev/tty12
_________________
Regards

root is the root of all evil
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2614

PostPosted: Fri Jun 23, 2017 9:28 am    Post subject: Reply with quote

kikko wrote:
How is yours?
I have rc_logger="YES". If I coment it out or set "NO", the /var/log/rc.log is no longer written at all.

kikko wrote:
And which version of OpenRC are you using?
I am on sys-apps/openrc-0.26.3::gentoo

kikko wrote:
Furthermore, that syslog-ng config only writes /var/log/messages and the raw output on /dev/tty12
That's true (version here is app-admin/syslog-ng-3.7.3). The log in /var/log/rc.log gets written even with syslog-ng disabled. So there seems to be something wrong with openrc's rc_logger.

Edit: What a nice feature!
Checking /var/log/rc.log after shutdown using another system shows the latest rc shutdown logging ... only once.
Deleting the /var/log/rc.log file while the system is down shows there is the other rc shutdown logging ... (identical content) getting written on boot. Seems to be stored somewhere else during shutdown?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum