open-vm-tools/vmware-user-autostart-wrapper

27 lines
633 B
Bash

#!/bin/sh
MAX_RETRY=8
RETRY=0
SLEEP=1
unset SESSION_MANAGER
# If running systemd, skip the delay loop as starting vmblock-fuse is not enforced
if file /sbin/init | grep -qv "systemd"; then
while [ $RETRY -lt $MAX_RETRY ]; do
if [ -f /var/run/vmblock-fuse/dev ]; then
RETRY=$MAX_RETRY
else
logger "Try $RETRY/$MAX_RETRY : /var/run/vmblock-fuse/dev not available. sleeping for $SLEEP seconds"
sleep $SLEEP
RETRY=$(($RETRY + 1))
SLEEP=$(($SLEEP * 2))
fi
done
fi
# Unconditionally start vmware-user-suid-wrapper (after waiting for vmblock-fuse if not under systemd)
/usr/bin/vmware-user-suid-wrapper