This commit is contained in:
parent
a5a403501a
commit
b87fff44c4
@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 15m
|
||||
UPDATES_SLEEP=900
|
||||
UPDATES_VM=`qvm-get-updatevm`
|
||||
|
||||
QREXEC_CLIENT=/usr/lib/qubes/qrexec_client
|
||||
|
||||
if [ -z "$UPDATES_VM" ]; then
|
||||
echo "UpdateVM not set, exiting!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Waiting for UpdateVM to be started"
|
||||
# Intentionally used xl domid here to check if domain is running (in case of
|
||||
# eg. stale qrexec socket)
|
||||
while ! [ -S /var/run/qubes/qrexec.`xl domid "$UPDATES_VM" 2>/dev/null` ]; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
(
|
||||
# Allow only one instance
|
||||
flock --nonblock -s 200 || exit 1
|
||||
while true; do
|
||||
qvm-sync-dom0-clock
|
||||
|
||||
sleep $UPDATES_SLEEP
|
||||
done
|
||||
|
||||
|
||||
) 200> /var/run/qubes/clock-watch-lock
|
1
dom0/aux-tools/qubes-sync-clock.cron
Executable file
1
dom0/aux-tools/qubes-sync-clock.cron
Executable file
@ -0,0 +1 @@
|
||||
*/6 * * * * root /usr/bin/qvm-sync-clock > /dev/null 2>&1 || true
|
@ -50,8 +50,6 @@ start()
|
||||
MEMINFO_DELAY_USEC=100000
|
||||
/usr/lib/qubes/meminfo-writer $MEM_CHANGE_THRESHOLD_KB $MEMINFO_DELAY_USEC &
|
||||
|
||||
/usr/lib/qubes/keep-dom0-clock-synced > /var/log/qubes/dom0-clock-sync.log 2>&1 &
|
||||
|
||||
touch /var/lock/subsys/qubes_core
|
||||
success
|
||||
echo
|
||||
|
@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
CLOCK_VM=`qvm-get-clockvm`
|
||||
|
||||
QREXEC_CLIENT=/usr/lib/qubes/qrexec_client
|
||||
|
||||
if [ -z "$CLOCK_VM" ]; then
|
||||
echo "ClockVM not set, exiting!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! xl domid "$CLOCK_VM" > /dev/null 2>&1; then
|
||||
echo "ClockVM not started, exiting!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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 $CLOCK_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][0-9] [A-Z]* [0-9][0-9][0-9][0-9]$'|
|
||||
head -1)"
|
||||
|
||||
if [ -n "$CURRENT_TIME" ] ; then
|
||||
echo Syncing Dom0 clock: setting time "$CURRENT_TIME"...
|
||||
sudo date -u -s "$CURRENT_TIME" ;
|
||||
echo Done. >&2
|
||||
else
|
||||
echo "Error while parsing the time obtained from the ClockVM ($CLOCK_VM).." >&2
|
||||
fi
|
||||
|
@ -106,7 +106,6 @@ cp ../qrexec/qrexec_client $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp ../qrexec/qrexec_policy $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp aux-tools/qfile-dom0-unpacker $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp aux-tools/qubes-receive-updates $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp aux-tools/keep-dom0-clock-synced $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp ../misc/block_add_change $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp ../misc/block_remove $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
cp ../misc/block_cleanup $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
@ -122,6 +121,7 @@ cp aux-tools/qubes.ReceiveUpdates.policy $RPM_BUILD_ROOT/etc/qubes_rpc/policy/qu
|
||||
cp aux-tools/qubes.ReceiveUpdates $RPM_BUILD_ROOT/etc/qubes_rpc/
|
||||
install -D aux-tools/qubes-dom0.modules $RPM_BUILD_ROOT/etc/sysconfig/modules/qubes-dom0.modules
|
||||
install -D aux-tools/qubes-dom0-updates.cron $RPM_BUILD_ROOT/etc/cron.daily/qubes-dom0-updates.cron
|
||||
install -D aux-tools/qubes-sync-clock.cron $RPM_BUILD_ROOT/etc/cron.d/qubes-sync-clock.cron
|
||||
|
||||
cp restore/qvm-create-default-dvm $RPM_BUILD_ROOT/usr/bin
|
||||
cp restore/xenstore-watch $RPM_BUILD_ROOT/usr/bin/xenstore-watch-qubes
|
||||
@ -329,7 +329,6 @@ fi
|
||||
/usr/lib/qubes/block_remove
|
||||
/usr/lib/qubes/block_cleanup
|
||||
%attr(4750,root,qubes) /usr/lib/qubes/qfile-dom0-unpacker
|
||||
/usr/lib/qubes/keep-dom0-clock-synced
|
||||
%attr(770,root,qubes) %dir /var/lib/qubes
|
||||
%attr(770,root,qubes) %dir /var/lib/qubes/vm-templates
|
||||
%attr(770,root,qubes) %dir /var/lib/qubes/appvms
|
||||
@ -382,6 +381,7 @@ fi
|
||||
/etc/security/limits.d/99-qubes.conf
|
||||
/etc/udev/rules.d/99-qubes_block.rules
|
||||
/etc/cron.daily/qubes-dom0-updates.cron
|
||||
/etc/cron.d/qubes-sync-clock.cron
|
||||
/etc/dracut.conf.d/*
|
||||
%dir /usr/share/dracut/modules.d/90qubes-pciback
|
||||
/usr/share/dracut/modules.d/90qubes-pciback/*
|
||||
|
Loading…
Reference in New Issue
Block a user