dom0: qubes-watch-updates & qvm-dom0-upgrade: use qvm-sync-dom0-clock

This commit is contained in:
Joanna Rutkowska 2011-08-02 14:14:50 +02:00
parent 49bfe8921c
commit 9c58c97571
2 changed files with 5 additions and 6 deletions

View File

@ -58,13 +58,8 @@ while true; do
done
# At the end synchronize clock
qvm-sync-dom0-clock
# dd is supposed to not allow memory exhaustion
# grep does basic sanity checking
# there seems to be no way to pass output of date +%s.%N to date,
# so we use human-readable format
CURRENT_TIME="$($QREXEC_CLIENT -d $UPDATES_VM 'user:date -u' | dd count=1 2>/dev/null | grep '^[A-Za-z]* [A-Za-z]* [0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] UTC [0-9][0-9][0-9][0-9]$'|head -1)"
if [ -n "$CURRENT_TIME" ] ; then sudo date -u -s "$CURRENT_TIME" ; fi
sleep $UPDATES_SLEEP
done

View File

@ -6,6 +6,10 @@ if [ -z "$UPDATEVM" ]; then
exit 1
fi
# We should ensure the clocks in Dom0 and UpdateVM are in sync
# becuase otherwise yum might complain about future timestamps
qvm-sync-dom0-clock
echo "Checking for dom0 updates"
# Start VM if not running already