FS#3854 - procd / inittab does not restart compiled c application when it closes #8860
Supply the following if possible:
Issue Overview: I have a test application that should be respawned via procd when/if it is ever closed. Procd doesn't re-launch this application. I have built a test app (detailed below) to limit the variables in testing.
Device: GL-iNet GL-MT300N-V2
I am building a fairly a stripped-down build of OpenWRT. However, from what I can tell at least, I should have at least the minimum required dependencies/packages/etc. for the application to be respawned correctly.
Source code for this app:
Launcher (This is what should respawn on app end)
I have confirmed that application is compiled correctly and will run correctly when it is directly run. I have also confirmed that shell script in /bin/ folder will respawn as expected. It just seems that the compiled application itself will not respawn.
The text was updated successfully, but these errors were encountered:
Is your "HelloWorldBase" program spawning further childs? Is your wait() call actually reaping the result of the execve() invoked process or just some unrelated child process? Does it work if you ignore the SIGCHLD signal in the parent process?
procd itself will also waitpid() for the respawn process, if that does not return due to unreaped child zombies, the process ius never considered finished and will not get respawned.
Thanks for the resopnse,
After looking at the git page for procd and attempting to educate myself on exactly how things work and what may have changed, I tend to agree it's hard to believe there would be a bug with procd itself - however, I feel as if I've done my best to isolate any variables on my end:
I have an application and a script
Any updates on this? I installed 21.02 fresh and can verify that respawn isn't working with a simple script. Runs once and does NOT respawn. So the initial run of the respawn works and the respawn itself never happens. I have fully moved my app/script over to a procd init script to work on 19.07, but it's not ideal.
Docs suggest that respawn works via inittab and in every case I've tried so far, even with a simple script that just says 'hello' and exits, it will not respawn.
This seems to be due to handing all of the busybox init duties over to procd? Am I mistaken there?
After testing it pretty extensively with many different builds, the respawn just isn't working, so either the docs are wrong or I'm wrong with the suggested functionality. But I would think that just having a simple script that exits would respawn if I told it to with inittab.
Script (Located in /bin/script):
I tried without and with the exit.