troglobit / finit

Fast init for Linux. Cookies included
https://troglobit.com/projects/finit/
MIT License
632 stars 63 forks source link

finit timeout when reboot #321

Closed hongkongkiwi closed 1 year ago

hongkongkiwi commented 1 year ago

After booting and quickly logging in (via serial) I get this from finit.

It seems only if I try to do it early after boot and finit is busy doing something.

It does actually reboot after that, but it's weird it tells me about a timeout?

~ # reboot
reboot: Timed out waiting for reply from Finit.
[ OK ] Saving random seed
.......
troglobit commented 1 year ago

The reboot program is basically the same program as initctl. Previous iterations of the reboot for Finit used signals, like BusyBox and the original SysV init. This is still supported (so you can use the BusyBox reboot), but now the default is to send an IPC command and wait for 'ACK' from Finit.

I've never seen this particular timeout (2 sec) when using reboot, probably busy with something else (starting up or restarting things, I guess).

If you like, you can tweak this timeout to see if 3 seconds help:

https://github.com/troglobit/finit/blob/70c29395962312c8ac7027c13ef1a8d23f7008da/src/client.c#L110-L118

It's a bit of a philosophical question, should the reboot/halt/(suspend)/poweroff commands perhaps be exempt and have an impossibly long timeout? Because they should never return, I mean.

hongkongkiwi commented 1 year ago

This was a weird edge case, I don't really have a good way to reproduce this. I'm going to close it.