I am using a BeagleBone running Debian. I have a cron entry in /etc/crontab which tells the device to reboot at 03:01 every night as follows
00 03 * * * root /sbin/shutdown -r +1 >> /home/my.log 2>&1
This has worked perfectly for many months. The device shutdown and rebooted at 03:01 as expected.
However now, the device shuts down at 03:01, but the reboot doesn't happen until many hours later. In the case of today, it shut down at 03:01 but didn't actually reboot until 12:35:28, over 9.5 hours later.
With command last reboot , here is the response :
reboot system boot 4.14.71-ti-r80 Sat Aug 17 12:35 still running
reboot system boot 4.14.71-ti-r80 Fri Aug 16 08:58 - 03:01 (18:02)
reboot system boot 4.14.71-ti-r80 Thu Aug 15 07:29 - 03:01 (19:31)
reboot system boot 4.14.71-ti-r80 Wed Aug 14 04:41 - 03:01 (22:19)
reboot system boot 4.14.71-ti-r80 Tue Aug 13 08:27 - 03:01 (18:33)
reboot system boot 4.14.71-ti-r80 Mon Aug 12 09:37 - 03:01 (17:23)
When I check journalctl -b , here is the response :
Aug 17 12:35:28 beaglebone kernel: Booting Linux on physical CPU 0x0
Aug 17 12:35:28 beaglebone kernel: Linux version 4.14.71-ti-r80 (root@b2-
am57xx-beagle-x15-2gb) (gcc version 6.3.0 20170516 (Debian 6.3.
Aug 17 12:35:28 beaglebone kernel: CPU: ARMv7 Processor [413fc082] revision
2 (ARMv7), cr=10c5387d
Aug 17 12:35:28 beaglebone kernel: CPU: PIPT / VIPT nonaliasing data cache,
VIPT aliasing instruction cache
Aug 17 12:35:28 beaglebone kernel: OF: fdt: Machine model: TI AM335x
BeagleBone Black
What can be causing this issue? I am finding it very hard to diagnose. Thanks
sync
command won't work because when you shutdown then it already does async
and I don't think it's because of write cache takes 9hrs to flush. This may be caused by a misconfigured systemd service having an infinite stop timeout or some number that's really high (like 9.5hrs), have a look here: https://unix.stackexchange.com/questions/227017/how-to-change-systemd-service-timeout-value also if you desperately need to reboot, you could tryecho 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
, be careful with that because it won't sync anything, you'll lose unsaved data – minhng99 Aug 17 '19 at 14:04journalctl -b -1
to get the logs from the previous boot session. it should end with$date $time $hostname systemd-journald[$pid] Journal stopped
. that will at least tell you when journald stopped. and give you a history of what was stopped and when before that. obviously nothing after that will or can be logged. – cas Aug 17 '19 at 17:03