troglobit / finit

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

initctl doesn’t complete restart when command is isssued from app to restart #280

Closed hongkongkiwi closed 2 years ago

hongkongkiwi commented 2 years ago

So I have an app which calls initctl restart to restart itself. Well actually I’m calling restart on the whole group, there’s many different apps in the names group.

But I’ve found that when the app dies it kills the child process of initctl.

The app only stops but doesn’t restart again. My theory is that initctl dies after sending the stop command and never gets to sending the start command.

I sort of expect that a restart command once sent is left Upto finit to handle so even if initctl is killed it should complete the restarting.

I’ve got a workaround for now but I wanted to report it as an issue.

troglobit commented 2 years ago

Yes, that's a current limitation, unfortunately. We had an implementation in Finit before, which caused other problems, so the restart (stop + start) functionality was moved to initctl. I don't think anyone expected restart on oneself as a use-case.

I'll see what we can come up with, likely fold it into the state machine redesign already planned.

troglobit commented 2 years ago

There, should work better now. Also added a regression test for it so we don't stumble upon this again.