Totally stumped: Cannot run rsync via ROOTCMD

John G. Heim jheim at math.wisc.edu
Wed Sep 3 17:45:19 CEST 2014


I have been working on a problem on and off for weeks. I am trying to 
run rsync via a ROOTCMD in a script.  During an install, the rsync does 
nothing. If I ssh to the machine during the install and run the script 
manually, it works. It also works when run via fai softupdate after the 
install.   I've even cut/pasted the rsync command from the script, sshed 
to the machine during the install,typed 'chroot /target', and pasted the 
command into the ssh window. So I know the rsync command works if you 
change root to /target. It's just that during an install, when run via 
the fai installer, it does nothing. I'll cut/paste the whole script at 
the end of this message but here is a list of some of the versions of 
the command that I have tried:

1. ${ROOTCMD} rsync --archive --delete --numeric-ids --hard-links 
--password-file=/usr/local/etc/rsyncd.key faiserver::local/ /usr/local/
2. ${ROOTCMD} /usr/bin/rsync --archive --delete --numeric-ids 
--hard-links --password-file=/usr/local/etc/rsyncd.key faiserver::local/ 
/usr/local/
3. ${ROOTCMD} /usr/bin/rsync --progress --archive --delete --numeric-ids 
--hard-links --password-file=/usr/local/etc/rsyncd.key faiserver::local/ 
/usr/local/ >> /root/install.log
4. ${ROOTCMD} bash -c "/usr/bin/rsync --progress --archive --delete 
--numeric-ids --hard-links --password-file=/usr/local/etc/rsyncd.key 
faiserver::local/ /usr/local/ >> /root/install.log"

Note: When the script fails during an install, /root/install.log is empty.

Here is the entire script:

#! /bin/bash
error=0 ; trap "error=$((error|1))" ERR
fcopy -B -m root,root,0600 /usr/local/etc/rsyncd.key
echo "Beginning rsync"
${ROOTCMD} bash -c "/usr/bin/rsync --progress --archive --delete 
--numeric-ids --hard-links --password-file=/usr/local/etc/rsyncd.key 
faiserver::local/ /usr/local/ >> /root/install.log"
exit $error
# EOF


More information about the linux-fai mailing list