finish bind mount, removed in next commit
authorIan Kelling <ian@iankelling.org>
Tue, 25 Apr 2017 22:36:00 +0000 (15:36 -0700)
committerIan Kelling <ian@iankelling.org>
Tue, 25 Apr 2017 22:36:00 +0000 (15:36 -0700)
conflink

index 6a9e4ff975c40de0ed248cde96a60a27475c249a..50747a327e57e9ca7be960ada8c5ac14c242eab7 100755 (executable)
--- a/conflink
+++ b/conflink
@@ -60,6 +60,7 @@ common-file-setup() {
         if [[ -e $bdir && $USER == ian ]]; then
             for f in $(find $bdir -type f); do
                 dst=/home/ian/${f##$bdir}
+                binds+="$f $dst none bind 0 0"$'\n'
                 if [[ ! -e $dst || $(stat -c%i $f $dst |uniq -u) ]]; then
                     if mountpoint -q $dst; then
                         s umount $dst
@@ -80,6 +81,7 @@ common-file-setup() {
     done
 }
 
+binds=""
 all_dirs=({/a/c,/p/c}{,/machine_specific/$HOSTNAME})
 # note, we assume a group of hosts does not have the
 # same name as a single host, which is no problem on our scale.
@@ -92,7 +94,12 @@ case $USER in
     ian)
         # p needs to go first so .ssh link is created, then config link inside it
         common-file-setup ${all_dirs[@]}
+        if [[ $binds ]]; then
+            s /a/exe/cedit conflink /etc/fstab <<<"$binds" || [[ $? == 1 ]]
+        fi
         if [[ -d /etc/bind/bind-writable ]]; then
+            # need bind writable dir for nsupdate, or else we get
+            # named[20823]: /etc/bind/db.iank.pw.jnl: create: permission denied
             s chgrp bind /etc/bind/bind-writable
         fi
         sudo -u traci "$BASH_SOURCE"