From 52cd7b76af482cf3ecbf0f9a857003506d8135fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 20 Jan 2021 11:57:20 +0100 Subject: 9vm: Introduce small delay in start function Otherwise, pgrep will fail, because screen + QEMU takes a fraction of a second longer to start. I found it simplest to sleep a whole second before running pgrep. --- etc/init.d/9vm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/init.d/9vm b/etc/init.d/9vm index 1a13fd9..24d1804 100755 --- a/etc/init.d/9vm +++ b/etc/init.d/9vm @@ -5,7 +5,7 @@ description='Plan 9 virtual machine' VMPATH=/9 SESSION=9vm -CMD='sh /9/startcon' +CMD=/9/startcon PATTERN=qemu-system-i386 depend() { @@ -15,6 +15,7 @@ depend() { start() { ebegin Starting Plan 9 virtual machine (cd $VMPATH && screen -h 1024 -dmS $SESSION $CMD) + sleep 1 if pgrep -f "$PATTERN" > /dev/null then eend 0 -- cgit v1.2.3