second call of 'initctl start' leads to fork instead of exec ('mount: / is busy' during shutdown)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
Critical
|
Unassigned | ||
upstart (Ubuntu) |
Fix Released
|
Critical
|
Stéphane Graber | ||
Raring |
Won't Fix
|
Critical
|
Unassigned | ||
Saucy |
Fix Released
|
Critical
|
Stéphane Graber |
Bug Description
The real case for this issue is the Bug lp: #1181528 (ureadahead)
"/etc/init.
and a variant of Bug lp: #1073433
"Ext4 corruption associated with shutdown of Ubuntu 12.10"
Upstart holds a file open for writing so /etc/init.
can not cleanly remount root filesystem readonly.
Assume the following job description that is simulation of
ureadahead-
<file name="lazy-
description "Debug open log file issue"
manual
expect fork
normal exit 0 4
exec /bin/sh -c 'echo "I am tired" >&2 ; exit 4 '
</file>
Let's start it
start lazy-daemon
[ 8433.561627] init: Connection from private client
[ 8433.563649] init: lazy-daemon goal changed from stop to start
[ 8433.563854] init: lazy-daemon state changed from waiting to starting
[ 8433.564474] init: Handling starting event
[ 8433.564797] init: lazy-daemon state changed from starting to pre-start
[ 8433.565106] init: lazy-daemon state changed from pre-start to spawned
[ 8433.567494] init: lazy-daemon main process (3673)
[ 8433.569516] init: lazy-daemon main process (3673) executable changed
[ 8433.570797] init: lazy-daemon main process (3673) terminated with status 4
[ 8433.571183] init: lazy-daemon goal changed from start to stop
[ 8433.571597] init: lazy-daemon state changed from spawned to stopping
[ 8433.571981] init: Handling stopping event
[ 8433.572459] init: lazy-daemon state changed from stopping to killed
[ 8433.572817] init: lazy-daemon state changed from killed to post-stop
[ 8433.573164] init: lazy-daemon state changed from post-stop to waiting
[ 8433.574376] init: Handling stopped event
lazy-daemon stop/waiting
In general everything works as expected (However I am in doubt
concerning 'executable changed'
Let's start again (One more mount and call of ureadahead-other
for it)
start lazy-daemon
[ 8493.929425] init: Connection from private client
[ 8493.931370] init: lazy-daemon goal changed from stop to start
[ 8493.931576] init: lazy-daemon state changed from waiting to starting
[ 8493.931817] init: Handling starting event
[ 8493.932444] init: lazy-daemon state changed from starting to pre-start
[ 8493.932750] init: lazy-daemon state changed from pre-start to spawned
[ 8493.935620] init: lazy-daemon main process (3681)
[ 8493.937540] init: lazy-daemon main process (3681) became new process (3682)
[ 8493.937620] init: lazy-daemon state changed from spawned to post-start
[ 8493.937860] init: lazy-daemon state changed from post-start to running
[ 8493.938093] init: Handling started event
lazy-daemon start/running, process 3682
I do not expect fake fork here. There is no 3682 process.
In any case upstart has to close the log file
ps uw 3682
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
initctl status lazy-daemon
lazy-daemon start/running, process 3682
lsof | grep lazy-daemon
init 1 root 13w REG 8,2 24 2888252 /var/log/
Bug lp: #1130611 "Upstart never closes /var/log/
might be related to this issue
Versions:
Ubuntu 13.10 Raring i686
upstart: Installed: 1.8-0ubuntu1
Related branches
- Daniël Sonck: Approve
-
Diff: 18561 lines (+11017/-1183) (has conflicts)73 files modified.bzrignore (+4/-0)
ChangeLog (+365/-0)
Makefile.am (+1/-1)
NEWS (+35/-1)
TESTING.sessions (+289/-0)
conf/rc-sysinit.conf (+2/-0)
configure.ac (+7/-3)
contrib/bash_completion/upstart (+96/-36)
contrib/vim/syntax/upstart.vim (+61/-27)
dbus/Upstart.conf (+6/-36)
dbus/com.ubuntu.Upstart.xml (+7/-0)
dbus/upstart.h (+1/-1)
extra/Makefile.am (+125/-0)
extra/conf/upstart-socket-bridge.conf (+16/-0)
extra/conf/upstart-udev-bridge.conf (+16/-0)
extra/man/socket-event.7 (+92/-0)
extra/man/upstart-socket-bridge.8 (+47/-0)
extra/man/upstart-udev-bridge.8 (+57/-0)
extra/upstart-socket-bridge.c (+644/-0)
extra/upstart-udev-bridge.c (+310/-0)
init/Makefile.am (+12/-0)
init/conf.c (+504/-55)
init/conf.h (+45/-2)
init/control.c (+111/-19)
init/control.h (+19/-1)
init/environ.c (+0/-1)
init/environ.h (+0/-1)
init/event.c (+22/-0)
init/event.h (+6/-1)
init/event_operator.c (+59/-0)
init/event_operator.h (+8/-0)
init/job.c (+47/-3)
init/job.h (+4/-1)
init/job_class.c (+115/-67)
init/job_class.h (+62/-2)
init/job_process.c (+122/-14)
init/job_process.h (+5/-3)
init/main.c (+297/-134)
init/man/init.5 (+236/-48)
init/man/init.8 (+32/-4)
init/parse_conf.c (+6/-0)
init/parse_job.c (+21/-7)
init/parse_job.h (+4/-2)
init/paths.h (+75/-2)
init/session.c (+320/-0)
init/session.h (+89/-0)
init/tests/test_blocked.c (+4/-1)
init/tests/test_conf.c (+1310/-15)
init/tests/test_control.c (+15/-11)
init/tests/test_environ.c (+3/-1)
init/tests/test_event.c (+28/-25)
init/tests/test_event_operator.c (+3/-0)
init/tests/test_job.c (+71/-76)
init/tests/test_job_class.c (+56/-65)
init/tests/test_job_process.c (+34/-30)
init/tests/test_parse_conf.c (+3/-0)
init/tests/test_parse_job.c (+302/-260)
init/tests/test_process.c (+3/-0)
init/tests/test_system.c (+3/-0)
po/POTFILES.in (+2/-0)
po/upstart.pot (+352/-155)
scripts/Makefile.am (+25/-0)
scripts/init-checkconf.sh (+248/-0)
scripts/initctl2dot.py (+571/-0)
scripts/man/init-checkconf.8 (+73/-0)
scripts/man/initctl2dot.8 (+87/-0)
util/Makefile.am (+1/-1)
util/initctl.c (+1014/-17)
util/initctl.h (+458/-0)
util/man/initctl.8 (+207/-34)
util/reboot.c (+0/-1)
util/tests/test_initctl.c (+1189/-19)
util/tests/test_user_sessions.sh (+553/-0)
summary: |
- upstart fails to track premature exit ('mount: / is busy' during - shutdown) + second call of 'initctl start' leads to fork instead of exec ('mount: / + is busy' during shutdown) |
Changed in upstart (Ubuntu): | |
importance: | Undecided → Critical |
assignee: | nobody → Stéphane Graber (stgraber) |
Changed in upstart (Ubuntu Saucy): | |
status: | Confirmed → Triaged |
Changed in upstart (Ubuntu Raring): | |
status: | New → Triaged |
importance: | Undecided → Critical |
assignee: | nobody → Stéphane Graber (stgraber) |
Changed in upstart: | |
status: | New → Triaged |
importance: | Undecided → Critical |
status: | Triaged → Fix Committed |
Changed in upstart: | |
status: | Fix Committed → Fix Released |
Status changed to 'Confirmed' because the bug affects multiple users.