Comment 28 for bug 672177

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Oops, I'm still learning my way around the shutdown process and, indeed, I missed umountroot.

I went ahead and added another lsof right after the call to telinit u, right before MOUNT_FORCE_OPT=, and one *after* the remount of /.

It doesn't seem to make any difference:

clint@natty-alpha1:~$ grep DEL /lastlsof-umountroot-post
init 1 root DEL REG 251,0 399637 /lib/libnss_files-2.12.2.so
init 1 root DEL REG 251,0 399636 /lib/libnss_nis-2.12.2.so
init 1 root DEL REG 251,0 399630 /lib/libnsl-2.12.2.so
init 1 root DEL REG 251,0 399643 /lib/libnss_compat-2.12.2.so.dpkg-new
init 1 root DEL REG 251,0 399644 /lib/libc-2.12.2.so
init 1 root DEL REG 251,0 390256 /lib/librt-2.12.2.so
init 1 root DEL REG 251,0 399646 /lib/libpthread-2.12.2.so
init 1 root DEL REG 251,0 399647 /lib/ld-2.12.2.so
clint@natty-alpha1:~$ grep DEL /lastlsof-umountroot
init 1 root DEL REG 251,0 399637 /lib/libnss_files-2.12.2.so
init 1 root DEL REG 251,0 399636 /lib/libnss_nis-2.12.2.so
init 1 root DEL REG 251,0 399630 /lib/libnsl-2.12.2.so
init 1 root DEL REG 251,0 399643 /lib/libnss_compat-2.12.2.so.dpkg-new
init 1 root DEL REG 251,0 399644 /lib/libc-2.12.2.so
init 1 root DEL REG 251,0 390256 /lib/librt-2.12.2.so
init 1 root DEL REG 251,0 399646 /lib/libpthread-2.12.2.so
init 1 root DEL REG 251,0 399647 /lib/ld-2.12.2.so

I even tried forcing the telinit u by doing 'touch /var/run/init.upgraded', and verified that it ran by adding -x and a sleep at the end of umountroot.

This makes sense, because telinit u just sends SIGTERM to upstart, which has no handler, as it was removed by revision 977, and doesn't seem to have been added back. Since SIG_DFL signals are not delivered to init, I'm not sure how umountroot's call to 'telinit u' can help in this case.

Unless I'm missing something in upstart's code (quite likely) I think there may still potentially need to be a change in upstart to support re-executing.

Another option if this can't be pushed into upstart is to mount a special readonly filesystem at boot just for init's libraries. However, it seems that re-execcing would be simpler than trying to get that right.