Totally stumped: Cannot run rsync via ROOTCMD

Bjarne Bertilsson bjarne.bertilsson at
Thu Sep 4 07:32:58 CEST 2014

do you run the script with $ROOTCMD? Then I guess you have to drop the $ROOTCMD inside the script and also copy the rsync pw file to somewhere inside /target.
Or handle everthing without the chroot.


Sent from Samsung Mobile

-------- Original message --------
From: "John G. Heim" <jheim at>
Date: 03/09/2014 17:46 (GMT+01:00)
To: linux-fai at
Subject: Totally stumped: Cannot run rsync via ROOTCMD

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/
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

More information about the linux-fai mailing list