Skip to content

Commit eaa9467

Browse files
committed
Refine scripts
1. flock when startapp, check the lock when pause in rc.civ.post, if the lock cannot be acquired, then skip pause 2. sleep 3 seconds before pause in lg_launcher.sh, give a window for guest to complete some tasks Tracked-On: OAM-100189 Signed-off-by: Yadong Qi <yadong.qi@intel.com>
1 parent c1c0333 commit eaa9467

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

host/bins/cfc-0.1.0-x64.deb

428 Bytes
Binary file not shown.

host/src/pack/dpkg/etc/rc.civ.post

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ balloon_civ
6565

6666
/opt/lg/bin/LG_B1_Client_clipboard guestClipboard:enable=true &
6767

68-
pause_civ
68+
flock -n -x /var/lock/civ_startapp.lock pause_civ ||
6969

7070
exit 0

host/src/pack/dpkg/opt/cfc/mwc/bin/lg_launcher.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ if [ "$num_start_app" -lt "1" ];
2929
then
3030
if ! systemctl --user is-active civ ;
3131
then
32-
/opt/lg/bin/startapp
32+
flock -x /var/lock/civ_startapp.lock /opt/lg/bin/startapp
33+
# startapp might spwan a adb server which will hold the lock even after startapp exit, kill the adb server here to release the lock
34+
adb kill-server
3335
fi
3436
# Resume CiV
3537
/opt/cfc/mwc/bin/resume_civ.sh
@@ -97,6 +99,9 @@ if [ ! -z ${ENABLE_CIV_BALLOON} ]; then
9799
fi
98100
fi
99101

102+
# delay for guest to finish some tasks
103+
sleep 3
104+
100105
# Pause CiV
101106
if [ -z "$(pidof mwc_launcher)" ] && [ -z "$(pidof LG_B1_Client)" ] && [ -z "$(pgrep -ax adb | grep -v "fork-server")" ]; then
102107
/opt/cfc/mwc/bin/pause_civ.sh

host/src/pack/dpkg/var/lock/civ_startapp.lock

Whitespace-only changes.

0 commit comments

Comments
 (0)