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

27 lines
645 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 "systemd" &>/dev/null); 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