#!/bin/bash -x set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR # based on unison error, with 8192 from # sysctl -a | grep fs.inotify.max_user_watches #http://stackoverflow.com/questions/535768/what-is-a-reasonable-amount-of-inotify-watches-with-linux echo "fs.inotify.max_user_watches = 1000000" >> $target/etc/sysctl.d/99-sysctl.conf # if we weren't rebooting, you could apply it now with: # sysctl --system echo 'ian ALL=(ALL) NOPASSWD: ALL' >> $target/etc/sudoers dir=/q/p/c/machine_specific/$HOSTNAME/.unison $ROOTCMD mkdir -p $dir $ROOTCMD rm -rf /root/.unison $ROOTCMD ln -s $dir /root $ROOTCMD ln -s /q/p / while true; do $ROOTCMD chown 1000:1000 $dir $ROOTCMD chmod 700 $dir dir=$(dirname $dir) [[ $dir != /q ]] || break done # kvm is normally created by some package, # but unison doesn't like unknown groups, so make it now so initial sync works. $ROOTCMD groupadd kvm