Merge lp:~stgraber/upstart/upstart-fix-respawn into lp:upstart
Status: | Merged |
---|---|
Merged at revision: | 1498 |
Proposed branch: | lp:~stgraber/upstart/upstart-fix-respawn |
Merge into: | lp:upstart |
Diff against target: |
143 lines (+21/-10) 2 files modified
init/job_process.c (+0/-6) init/tests/test_job_process.c (+21/-4) |
To merge this branch: | bzr merge lp:~stgraber/upstart/upstart-fix-respawn |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Needs Fixing | ||
Review via email: mp+172420@code.launchpad.net |
Description of the change
This fixes a regression recently found when working on Ubuntu Touch.
The problem is that if a job has the respawn flag and doesn't contain any of the standard shell characters in its exec line, upstart will still set job->script to TRUE once the initial run has succeeded. This mean that on first respawn of the job, it'll end up forking one extra time and confuse upstart.
The change that introduced this was done to fix a case where tests would fail when running from a directory containing a shell character in its name (~test for example). The assumption at the time being that ->script wasn't persistent (clearly wrong) and that it wouldn't hurt to set it after the job has been started in order to simplify testing.
The fix is to revert the change to upstart itself and instead include the same shell characters list in the testsuite and have the testsuite check against it just like init itself does.
As discussed on IRC, this change should include an affirmative test case to ensure the correct values of ->script on respawn, to avoid this bug being reintroduced later.