~ubuntu-branches/ubuntu/precise/partman-target/precise-updates

« back to all changes in this revision

Viewing changes to finish.d/clear_partitions

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-04-19 11:54:45 UTC
  • Revision ID: package-import@ubuntu.com-20120419115445-w2fdllodj5r1qwit
Tags: 77ubuntu2
* Exit 0 at the end of finish.d/clear_partitions, so that partman-commit
  will carry on even if the final rmdir fails (which is a bug in itself,
  but shouldn't blow away the whole install; LP: #985526).
* Use 'umount -l' in finish.d/clear_partitions, to work around an as yet
  unidentified race that keeps the filesystem busy (LP: #946663).

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
                                db_set passwd/user-uid "$uid" || true
80
80
                        fi
81
81
                fi
82
 
                umount $tmp
 
82
                # Nothing should have anything in $tmp open at this point,
 
83
                # but apparently something does:
 
84
                #   https://bugs.launchpad.net/bugs/946663
 
85
                umount -l $tmp
83
86
        elif [ "$mp" = "/home" ]; then
84
87
                mount $path $tmp 3>&- || failed
85
88
                # Preserve the UID, if possible.
91
94
                                db_set passwd/user-uid "$uid" || true
92
95
                        fi
93
96
                fi
94
 
                umount $tmp
 
97
                # Nothing should have anything in $tmp open at this point,
 
98
                # but apparently something does:
 
99
                #   https://bugs.launchpad.net/bugs/946663
 
100
                umount -l $tmp
95
101
        else
96
102
                case "$mp" in
97
103
                        /usr/local|/usr/local/*|/var/local|/var/local/*|/usr/src|/usr/src/*)
104
110
                                mount $path $tmp 3>&- || failed
105
111
                                logger -t clear_partitions "Removing everything from $mp ($path)."
106
112
                                rm -rf $tmp/* || failed
107
 
                                umount $tmp
 
113
                                # Nothing should have anything in $tmp open
 
114
                                # at this point, but apparently something
 
115
                                # does:
 
116
                                #   https://bugs.launchpad.net/bugs/946663
 
117
                                umount -l $tmp
108
118
                                break
109
119
                        fi
110
120
                done
113
123
done
114
124
db_progress STOP
115
125
rmdir $tmp
 
126
 
 
127
exit 0