X configuration fails with NFS root (simple fix)

Bug #65763 reported by Roshan Shariff
2
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)
Fix Released
Undecided
Kees Cook

Bug Description

"dpkg-reconfigure xserver-xorg" fails when / is mounted on NFS. This is because:

1. xserver-xorg.postinst runs dexconf, which creates a directory like /tmp/dexconf-xxxx wherein it generates the new xorg.conf.

3. Dexconf deletes the temp file. This is implemented in nfs-kernel-server by creating a dotfile in the same directory, until the fd is closed. (See bug #65003 for a similar problem in ltsp)

4. When dexconf runs rm -rf on the /tmp/dexconf-* directory, it fails producing a "directory not empty" message, because the dotfile cannot be removed while dexconf is running.

5. xserver-xorg.postinst interprets the non-zero return code as a dexconf failure and therefore doesn't update /etc/X11/xorg.conf

The workaround I've been using so far is to run:

# dpkg-reconfigure xserver-xorg
# dexconf -o /etc/X11/xorg.conf
# rm -r /tmp/dexconf-*
# md5sum /etc/X11/xorg.conf > /var/lib/x11/xorg.conf.md5sum

But this is not ideal for obvious reasons. IMHO the solution to bug #65003 should work here.

Revision history for this message
Roshan Shariff (roshan.shariff) wrote :

This patch to /usr/bin/dexconf makes sure that each file is closed when it is no longer needed, so that dotfiles aren't left hanging around in /tmp/dexconf-tmp-*/. I've simply added "exec 4>&-" to match every "exec 4>something".

This fixes dpkg-reconfigure xserver-xorg for me.

Revision history for this message
Roshan Shariff (roshan.shariff) wrote : A much simpler patch

This simple patch only adds one line to the file, to close fd 4 before the rm -rf at the end. This is much less intrusive than the previous patch.

Needless to say, it works just fine for me.

Revision history for this message
Kees Cook (kees) wrote :
Kees Cook (kees)
Changed in xorg:
assignee: nobody → keescook
status: Unconfirmed → Fix Committed
Kees Cook (kees)
Changed in xorg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.