On Wed, 4 Dec 2019 13:44:42 +0530
Vikram Goyal <vikigoyal(a)gmail.com> wrote:
Hi,
I am facing a peculiar issue where a system reboot sometimes & not
always posts a crash in last output.
root pts/0 Wed Dec 4 11:47 still logged in
reboot system boot Wed Dec 4 11:30 - 11:57 (00:26)
root pts/0 Tue Dec 3 18:14 - crash (17:16)
reboot system boot Tue Dec 3 10:03 - 11:57 (1+01:53)
root pts/0 Mon Dec 2 18:03 - down (15:56)
reboot system boot Mon Dec 2 11:19 - 10:00 (22:40)
root pts/0 Sat Nov 30 17:22 - crash (1+17:57)
reboot system boot Sat Nov 30 10:36 - 10:00 (2+23:24)
root pts/0 Fri Nov 29 17:35 - down (16:56
I then created an alias - alias reboot='sync && sleep 3s && sync
&&
sleep 3s && /usr/bin/systemctl reboot'
[snip]
journal entries do not show any errors, but it is recorded as crash
in
last since there's no entry of - shutdown system down - in last.
last records sometimes a proper shutdown, many times as crash even
though the reboot is done similarly all the times.
What could be the issue or should I be concerned about it.
This sounds like a race condition. Since systemd runs things in
parallel instead of in sequence, variations in processing time can run
things in different order each time. If this means that dependencies
are stopped before the programs that depend on them, those programs
will crash. That is what I think is happening here. So, I would
consider this innocuous, a side effect of the way shutdown occurs.
However, this is just speculation, and I have no special knowledge that
indicates it is true.