On Wed, Feb 06, 2013 at 12:59:51PM +0100, Wolfgang Schweer wrote: > On Wed, Feb 06, 2013 at 10:39:08AM +0100, Petter Reinholdtsen wrote: > > [Wolfgang Schweer] > > > # Wait until /etc/hosts is writeable. > > > if [ -w /etc/hosts ] ; then > > > > I believe -w only check the file mode, not if the file system is > > mounted read-write. If so, this test do not work the way you expect > > it to. > > This code was tested on a server running d-e squeeze. Execution is > delayed by the first ltsp config hook, then executed by the second one > (when doing bind_mount). You are right, -w only checks the file mode. The code works -- but why? Among others the file /etc/hosts is mounted rw on top of /etc/hosts on the read-only file system. This way the ltsp configuration setup is able to write to these files. Note that sed -i won't work cause the temp file /etc/foo won't be writeable. In fact, the condition 'if [ -w /etc/hosts ]' could be dropped. Wolfgang
Attachment:
signature.asc
Description: Digital signature