2015-02-05 03:14:41 +01:00
|
|
|
#!/bin/sh
|
2012-07-12 14:21:44 +02:00
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
# This script must be run as the `user` user.
|
|
|
|
# It is customarily launched from prepare-dvm.sh.
|
|
|
|
|
|
|
|
# At this point, the DispVM home directory customizations
|
|
|
|
# undertaken by mount-dirs.sh have taken place.
|
|
|
|
# We know this because dispvm-prerun.sh executes after
|
|
|
|
# local-fs.target, and mount-dirs.sh runs before it.
|
|
|
|
|
|
|
|
me=$( basename "$0" )
|
2015-04-11 02:43:03 +02:00
|
|
|
apps="/usr/libexec/evinced"
|
2012-07-12 14:21:44 +02:00
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
echo "$me started." >&2
|
2012-07-12 14:21:44 +02:00
|
|
|
|
|
|
|
for app in $apps ; do
|
2016-10-22 17:43:16 +02:00
|
|
|
echo "Launching $app" >&2
|
|
|
|
$app &
|
2012-07-12 14:21:44 +02:00
|
|
|
done
|
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
echo "Waiting for I/O to quiesce" >&2
|
2012-07-12 14:21:44 +02:00
|
|
|
PREV_IO=0
|
|
|
|
while true; do
|
|
|
|
IO=`vmstat -D | awk '/read|write/ {IOs+=$1} END {print IOs}'`
|
2015-02-05 03:14:41 +01:00
|
|
|
if [ $IO -lt $(( $PREV_IO + 50 )) ]; then
|
2012-07-12 14:21:44 +02:00
|
|
|
break;
|
|
|
|
fi
|
|
|
|
PREV_IO=$IO
|
2015-04-11 02:43:03 +02:00
|
|
|
sleep 2
|
2012-07-12 14:21:44 +02:00
|
|
|
done
|
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
echo "Closing windows" >&2
|
2014-07-04 18:49:49 +02:00
|
|
|
/usr/lib/qubes/close-window `xwininfo -root -children|tail -n +7 |awk '{print $1}'`
|
|
|
|
sleep 1
|
2014-01-24 06:45:17 +01:00
|
|
|
fuser -vkm /rw
|
2014-07-04 18:49:49 +02:00
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
echo "$me finished." >&2
|