Changeset 103575 in vbox for trunk/src/VBox/Installer/linux/VBox.sh
- Timestamp:
- Feb 26, 2024 4:30:42 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/VBox.sh
r98103 r103575 97 97 fi 98 98 99 SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'` 99 # Get effective user name to use it in order to compose XPCOM IPC socket path. 100 VBOX_EFFECTIVE_USER="$(whoami)" 101 if [ -z "$VBOX_EFFECTIVE_USER" ]; then 102 cat << EOF 103 WARNING: Unable to detect effective user name. VirtualBox might run incorrectly. 104 EOF 105 fi 106 107 # Variables LOGNAME and USER are used by XPCOM code in order to 108 # compose IPC socket path. If they set to something which is different 109 # from the effective user name, it might result in misbehavior. 110 # Setting VBOX_IPC_SOCKETID will tell XPCOM code which path it should use explicitly. 111 [ -n "$LOGNAME" ] && [ "$LOGNAME" = "$VBOX_EFFECTIVE_USER" ] || vbox_override_env="1" 112 [ -n "$USER" ] && [ "$USER" = "$VBOX_EFFECTIVE_USER" ] || vbox_override_env="1" 113 114 if [ -n "$vbox_override_env" ]; then 115 cat << EOF 116 WARNING: Environment variable LOGNAME or USER does not correspond to effective user id. 117 EOF 118 export VBOX_IPC_SOCKETID="$VBOX_EFFECTIVE_USER" 119 fi 120 121 SERVER_PID=`ps -U "$VBOX_EFFECTIVE_USER" | grep VBoxSVC | awk '{ print $1 }'` 100 122 if [ -z "$SERVER_PID" ]; then 101 123 # Server not running yet/anymore, cleanup socket path. 102 124 # See IPC_GetDefaultSocketPath()! 103 if [ -n "$LOGNAME" ]; then 104 rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1 105 else 106 rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1 107 fi 125 rm -rf "/tmp/.vbox-$VBOX_EFFECTIVE_USER-ipc" > /dev/null 2>&1 108 126 fi 109 127
Note:
See TracChangeset
for help on using the changeset viewer.