syslogd/klog.service

40 lines
1.2 KiB
SYSTEMD
Raw Normal View History

# /lib/systemd/system/klog.service
#
# This file is part of package systemd.
#
# Copyright (c) 2011 SuSE LINUX Products GmbH, Germany.
# Author: Werner Fink
# Please send feedback to http://www.suse.de/feedback
#
# Description:
#
# Create the well known /var/log/boot.msg
# By using dmesg(1) the normal kernel and boot messages handled
# by systemd will not disappear. The character device /dev/tty10
# will be created by udevd and therefore should exists only if
# virtual consoles are available.
#
[Unit]
Description=Early Kernel Boot Messages
Requires=local-fs.target default.target
Wants=syslog.service
After=local-fs.target
Before=syslog.service default.target
RefuseManualStart=true
ConditionPathIsDirectory=/var/log
Alias=bootmsg.service
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=KLOGCONSOLE_PARAMS=
EnvironmentFile=-/etc/sysconfig/boot
ExecStart=/bin/sh -c "test -s /var/log/boot.msg && /bin/mv -f /var/log/boot.msg /var/log/boot.omsg || :"
ExecStart=/bin/sh -c "/bin/dmesg -r > /var/log/boot.msg"
ExecStart=/bin/sh -c "test -s /dev/shm/initrd.msg && /bin/cat /dev/shm/initrd.msg >> /var/log/boot.msg || :"
ExecStart=/bin/sh -c "test -c /dev/tty10 && /usr/sbin/klogconsole $KLOGCONSOLE_PARAMS -r10 || :"
[Install]
WantedBy=basic.target