dispvm: restart qubesdb at DispVM start

To connect to new qubesdb daemon in dom0.
This commit is contained in:
Marek Marczykowski 2013-06-10 04:37:20 +02:00 committed by Marek Marczykowski-Górecki
parent 1f04cf34cc
commit d00d52fc31
2 changed files with 16 additions and 10 deletions

View File

@ -52,13 +52,16 @@ start()
dmesg -c >/dev/null
free | grep Mem: |
(read a b c d ; qubesdb-write /qubes-used-mem $c)
# give dom0 time to read some entries, when done it will shutdown qubesdb,
# so wait for it
qubesdb-watch /stop-qubesdb
# just to make sure
systemctl stop qubes-db.service
# we're still running in DispVM template
echo "Waiting for save/restore..."
# ... wait until qubes-restore.c (in Dom0) recreates VM-specific keys
# TODO: restart qubesdb service before this
while ! qubesdb-read /qubes-restore-complete 2>/dev/null ; do
usleep 10
done
# the service will start only after successful restore
systemctl start qubes-db.service
echo Back to life.
fi

View File

@ -25,13 +25,16 @@ if qubesdb-read /qubes-save-request 2>/dev/null ; then
dmesg -c >/dev/null
free | grep Mem: |
(read a b c d ; qubesdb-write /qubes-used-mem $c)
# give dom0 time to read some entries, when done it will shutdown qubesdb,
# so wait for it
qubesdb-watch /stop-qubesdb
# just to make sure
systemctl stop qubes-db.service
# we're still running in DispVM template
echo "Waiting for save/restore..."
# ... wait until qubes-restore.c (in Dom0) recreates VM-specific keys
# TODO: restart qubesdb-daemon before this
while ! qubesdb-read /qubes-restore-complete 2>/dev/null ; do
usleep 10
done
# the service will start only after successful restore
systemctl start qubes-db.service
echo Back to life.
fi