Upstart gets confused if "expect daemon" "respawn" task exits before forking
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
New
|
Undecided
|
Unassigned |
Bug Description
The following simple .conf models the daemon which checks the configuration on start and exits on error:
-------
respawn
respawn limit 10 50
expect daemon
exec /bin/false
-------
If this .conf is run, Upstart gets confused:
root@vu:/etc/init# status foreground-exit
foreground-exit stop/waiting
root@vu:/etc/init# start foreground-exit
foreground-exit start/running
root@vu:/etc/init# status foreground-exit
foreground-exit start/running
root@vu:/etc/init#
So it still thinks this task is running. Worse, it does not respawn it:
[ 2387.766173] init: Connection from private client
[ 2387.767180] init: foreground-exit goal changed from stop to start
[ 2387.767270] init: foreground-exit state changed from waiting to starting
[ 2387.767369] init: Handling starting event
[ 2387.767476] init: foreground-exit state changed from starting to pre-start
[ 2387.767554] init: foreground-exit state changed from pre-start to spawned
[ 2387.794340] init: foreground-exit main process (17300)
[ 2387.795976] init: foreground-exit main process (17300) terminated with status 1
[ 2387.795996] init: foreground-exit main process ended, respawning
[ 2387.796063] init: foreground-exit state changed from spawned to post-start
[ 2387.796221] init: foreground-exit state changed from post-start to running
[ 2387.796319] init: Handling started event
If "expect daemon" is removed from the .conf, everything works as expected (respawns several times etc etc).
if "respawn" is removed from the .conf, everything also works as expected.
Only a combination of "expect daemon", "respawn" and failure before forking twice cause this issue.
Upstart version: 1.5
Contact me, I know how to fix.