I have minimalistic headless setup with base image and only shairport + hostapd installed. I shut down system by cutting power and after next boot it reboots and boot second time. How to avoid it and force to boot only once? Other distribution I used boots only once after dirty shutdown. My aim is headless no ups with minimum boot time to use in car. I do not need logs etc in my system and do not care about sd card life time. Thanks.
The same applies to your post, it doesn’t actually contain any information about your system. We don’t know what kind of board you are using or anything else.
how do you know that? how does it make you notice it?
This is not normal behaviour, in fact it should not occur at all. So there must be a reason for this behaviour.
but we need your logs, otherwise it is not possible to help.
Hardware is new Raspberry PI Zero 2 W.
I have usb logger and hdmi monitor attached. Both shows (no power input, no picture and system log on screen shows that system is restarting) that unit reboots in 10 seconds after first boot.
I made fresh sd card with latest image DietPi_RPi234-ARMv8-Bookworm from dietpi site. This bare system with all updates and only FULL log option in dietpi-config behave the same - reboots after 10 seconds after first login prompt.
Did log clear via journalctl --flush --rotate --vacuum-time=1s, reboot via cutting power and wait system to settle. Final log is attached.
log.txt (50.2 KB)
P.S Dietpi is just great. With all lightness and configuration possibilities I really enjoy it.
The log contains exactly one single boot process.
I apologize, my mistake. Here are new logs:
kern.log (70.3 KB)
syslog.txt (98.4 KB)
As you can see system reboots. Reboot occurs each time in 10 seconds after dirty shutdown and corresponding first boot.
The logs do not show why the system is acting like this. Also, you are the only one with the behaviour that actually indicates that it is something special about the system being used. Possibly a problem with the power supply? As I don’t have a PRi 2W, I tested it with a RPi4B. There everything works as it should and the system starts exactly 1 time.
Maybe @MichaIng has an idea.
You were right, the problem is related to the power supply. I use a powerbank to power the RPI. I switched the system to a regular power supply from the network and the system stopped rebooting a second time. I got curious and returned the power supply from the powerbank, but now with a cable that has no data lines, only +5v and ground for power. With it, the system no longer reboots a second time.
And although I can now use this cable to power the battery, I am still wondering what the problem could be? With another distro system behaves normally and does not reboot a second time.
As you have realised yourself, it seems to have been due to the power supply.
It depends on which other operating system was used. Perhaps a different kernel was used there which had a lower power consumption or which did not cause a peak in power consumption.
But the system behaves differently depending on whether the data lines in the power cable are connected or not.
Connecting stuff could easily increase power consumption.
I think the logs are misleading. Not sure how rsyslog
works exactly, but fake-hwclock
adjust the system clock so that the earlier logs have a newer timestamp than the later logs, by about half a second. And fake-hwclock
is visible only on the first logs block. Probably this distorts the logs.
Might be better to verify via persistent journald
logs:
systemctl disable --now rsyslog
mkdir /var/log/journal
systemctl restart systemd-journald
And then after reboot check via journalctl
. It shows delimiters for boot sessions. Newer versions also show it correctly chronologically sorted, instead of by timestamps, so that jumps or splits of boot sessions as of system clock changes are avoided.
If it really has to do with insufficient power/voltage (which at least is not indicated in the logs, usually there would be related entries), at least to check whether this stabilizes boot, you could change initial_turbo=20
to initial_turbo=0
in /boot/config.txt
. But if it help, it means your PSU or cable is insufficient, and need to be replaced anyway to guarantee stable operation on high loads.