systemd.log_target= :: writing the log as "dmesg -dxt" would show

T.C. Hollingsworth tchollingsworth at gmail.com
Sat Mar 17 18:23:11 UTC 2012


On Sat, Mar 17, 2012 at 6:53 AM, Adrian Sevcenco
<Adrian.Sevcenco at cern.ch> wrote:
> Hi! i would like to see the dmesg.shutdown files the way that i would
> see the current messages as i would do dmesg -dtx ...
> the most important would be the -d (i try to debug a huge (2 min) wait
> time at shutdown given by NetworkManager that its get killed after some
> timeout)
> (to see delta of time in below messages)
>
> [ 1278.283432] type=1130 audit(1331824261.256:101): user pid=0 uid=0
> auid=4294967295 ses=4294967295 msg=': comm="plymouth-reboot"
> exe="/bin/systemd" hostname=? addr=? terminal=? res=success'
> [ 1366.364382] systemd[1]: NetworkManager.service stopping timed out.
> Killing.
> [ 1366.366230] systemd[1]: NetworkManager.service changed stop-sigterm
> -> stop-sigkill

It's a bit of a hack, but you could just run that command on shutdown.
 Add a file /etc/systemd/system/dmesg-shutdown.service or so with
this:

[Unit]
Description=Dump Kernel Messages at Shutdown
DefaultDependencies=no
Before=shutdown.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'dmesg -dtx > /var/log/dmesg-shutdown'

[Install]
WantedBy=shutdown.target

EOF

Then run `systemctl enable dmesg-shutdown.service`.

-T.C.


More information about the users mailing list