Changeset 95297 in vbox
- Timestamp:
- Jun 15, 2022 10:35:29 PM (2 years ago)
- Location:
- trunk/src/VBox/Installer/darwin/VirtualBox_mpkg
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/distribution-driverless.dist
r94866 r95297 15 15 <installer-gui-script minSpecVersion="1.0"> 16 16 <title>VirtualBox_title</title> 17 <options customize="allow" allow-external-scripts="yes"rootVolumeOnly="true" hostArchitectures="@VBOX_ARCH_LIST@"/>17 <options customize="allow" rootVolumeOnly="true" hostArchitectures="@VBOX_ARCH_LIST@"/> 18 18 <installation-check script="checkPrerequisite()"></installation-check> 19 19 <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/> … … 55 55 try 56 56 { 57 /* The following shell script uses tools which were added in 10.858 (Mountain Lion) and later, in particular pgrep and pkill. */59 if (system.compareVersions(system.version['ProductVersion'], '10.8') >= 0)57 /* Embedded scripts are not available here. Instead, run command to check for running VMs or running VBOX instance */ 58 runAppArr = system.applications.all() 59 for (let i = 0; i < runAppArr.length; i++) 60 60 { 61 /* Embedded scripts are not available here. So, just do a 62 command line checking if any VBoxXPCOMIPCD has more than one 63 client, and if there are none, kill all the usual suspects to 64 get a clean slate. This is done because the VirtualBox event 65 handling had a bug which allowed no longer present passive 66 event listeners to block VBoxSVC processes from exiting until 67 the waiting time was elapsed. In the extreme case this was 68 infinitely long, blocking updates. */ 69 system.run('/bin/sh', '-c', 'pids=`/usr/bin/pgrep VBoxXPCOMIPCD` rc=0; [ -z "$pids" ] && rc=1; for i in $pids; do c=`/usr/sbin/lsof -p $i | /usr/bin/grep -E \'^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +unix\' | wc -l`; [ $c -le 2 ] || rc=1; done; if [ $rc -eq 0 ]; then /usr/bin/pkill -KILL \'^(VirtualBox)|(VBoxNetDHCP)|(VBoxNetNAT)|(VBoxHeadless)|(VBoxXPCOMIPCD)|(VBoxSVC)$\'; sleep 1; fi'); 61 if (runAppArr[i]["FileCreator"] == "VBOX" || runAppArr[i]["FileCreator"] == "VBVM") 62 { 63 result = false; 64 } 70 65 } 71 } catch (e) { system.log(e); } 72 73 try 74 { 75 /* Embedded scripts are not available here. So, just do a command 76 line checking for running VMs instead. */ 77 rcScript = system.run('/bin/sh', '-c', '/bin/ps -e | /usr/bin/grep -E \'[V]irtualBox.*startvm|[V]BoxNetDHCP|[V]BoxNetNAT|[V]BoxHeadless|[V]BoxSVC\''); 78 result = (rcScript != 0); 79 system.log("system.run /bin/sh .. returned: " + rcScript + " result=" + result); 66 system.log("system.applications check => result=" + result); 80 67 } catch (e) { system.log(e); result = false; } 81 68 82 69 if (!result) 83 70 { 84 /* Temporary instrumentation for finding out with some probability85 * who keeps VBoxSVC busy (unix socket to VBoxXPCOMIPCD open). Needs86 * very little time (unlike a full lsof) and causes bearable amount87 * of messages to install.log so that it can stay in for a while. */88 try89 {90 system.run('/usr/sbin/lsof', '-l', '-U');91 } catch (e) { system.log(e); }92 71 93 72 my.result.type = 'Fatal'; -
trunk/src/VBox/Installer/darwin/VirtualBox_mpkg/distribution.dist
r94866 r95297 15 15 <installer-gui-script minSpecVersion="1.0"> 16 16 <title>VirtualBox_title</title> 17 <options customize="allow" allow-external-scripts="yes"rootVolumeOnly="true" hostArchitectures="@VBOX_ARCH_LIST@"/>17 <options customize="allow" rootVolumeOnly="true" hostArchitectures="@VBOX_ARCH_LIST@"/> 18 18 <installation-check script="checkPrerequisite()"></installation-check> 19 19 <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/> … … 55 55 try 56 56 { 57 /* The following shell script uses tools which were added in 10.858 (Mountain Lion) and later, in particular pgrep and pkill. */59 if (system.compareVersions(system.version['ProductVersion'], '10.8') >= 0)57 /* Embedded scripts are not available here. Instead, run command to check for running VMs or running VBOX instance */ 58 runAppArr = system.applications.all() 59 for (let i = 0; i < runAppArr.length; i++) 60 60 { 61 /* Embedded scripts are not available here. So, just do a 62 command line checking if any VBoxXPCOMIPCD has more than one 63 client, and if there are none, kill all the usual suspects to 64 get a clean slate. This is done because the VirtualBox event 65 handling had a bug which allowed no longer present passive 66 event listeners to block VBoxSVC processes from exiting until 67 the waiting time was elapsed. In the extreme case this was 68 infinitely long, blocking updates. */ 69 system.run('/bin/sh', '-c', 'pids=`/usr/bin/pgrep VBoxXPCOMIPCD` rc=0; [ -z "$pids" ] && rc=1; for i in $pids; do c=`/usr/sbin/lsof -p $i | /usr/bin/grep -E \'^[^ ]+ +[^ ]+ +[^ ]+ +[^ ]+ +unix\' | wc -l`; [ $c -le 2 ] || rc=1; done; if [ $rc -eq 0 ]; then /usr/bin/pkill -KILL \'^(VirtualBox)|(VBoxNetDHCP)|(VBoxNetNAT)|(VBoxHeadless)|(VBoxXPCOMIPCD)|(VBoxSVC)$\'; sleep 1; fi'); 61 if (runAppArr[i]["FileCreator"] == "VBOX" || runAppArr[i]["FileCreator"] == "VBVM") 62 { 63 result = false; 64 } 70 65 } 71 } catch (e) { system.log(e); } 72 73 try 74 { 75 /* Embedded scripts are not available here. So, just do a command 76 line checking for running VMs instead. */ 77 rcScript = system.run('/bin/sh', '-c', '/bin/ps -e | /usr/bin/grep -E \'[V]irtualBox.*startvm|[V]BoxNetDHCP|[V]BoxNetNAT|[V]BoxHeadless|[V]BoxSVC\''); 78 result = (rcScript != 0); 79 system.log("system.run /bin/sh .. returned: " + rcScript + " result=" + result); 66 system.log("system.applications check => result=" + result); 80 67 } catch (e) { system.log(e); result = false; } 81 68 82 69 if (!result) 83 70 { 84 /* Temporary instrumentation for finding out with some probability85 * who keeps VBoxSVC busy (unix socket to VBoxXPCOMIPCD open). Needs86 * very little time (unlike a full lsof) and causes bearable amount87 * of messages to install.log so that it can stay in for a while. */88 try89 {90 system.run('/usr/sbin/lsof', '-l', '-U');91 } catch (e) { system.log(e); }92 71 93 72 my.result.type = 'Fatal';
Note:
See TracChangeset
for help on using the changeset viewer.