]> git.pld-linux.org Git - packages/VMware-workstation.git/blobdiff - VMware-workstation.init
- updated to 6.0.4-93057
[packages/VMware-workstation.git] / VMware-workstation.init
index f3e6a4c2e9101c6114b427f0e590e5e845261278..5b88f5bbe7b3f2cbdb87cbf380de5bbbcf53ee62 100755 (executable)
@@ -8,7 +8,7 @@
 #
 # description: Manages the services needed to run VMware networking
 #
-# chkconfig:   5 90 8
+# chkconfig:   235 90 8
 #
 # probe:       true
 # hide:                true
@@ -32,15 +32,25 @@ vmnet_cfg="$vmware_etc_dir"/vmnet.conf
 for f in $vmware_locations $vmnet_cfg; do
        if [ -r $f ]; then
                . $f
-       else    
+       else
                echo "FATAL: Unable to read $f"
                exit 1
        fi
-done   
+done
 
 # System wide functions
 . /etc/rc.d/init.d/functions
 
+# Create /dev/vmnetXX device
+vmware_create_vmnet() {
+    local vHubNr="$1" # IN
+    local vDevice="/dev/vmnet$vHubNr"
+
+    if [ ! -e "$vDevice" ]; then
+       mknod -m 600 "$vDevice" c 119 "$vHubNr"
+    fi
+}
+
 #
 # Create a temporary directory
 #
@@ -286,21 +296,26 @@ case "$1" in
   start)
        if [ -f /var/lock/subsys/"$subsys" ]; then
                msg_already_running "VMware Workstation networking"
-       fi      
+       fi
        # Try to load parport_pc. Failure is allowed as it does not exist
        # on kernels 2.0
        /sbin/modprobe parport_pc >/dev/null 2>&1
+       msg_starting 'Virtual machine monitor'
+       busy
+       /sbin/modprobe $driver
+       [ "$?" -eq "0" ] && ok || fail
        if [ "$VM_NETWORKING" = 'yes' ]; then
                msg_starting 'Virtual ethernet'
                busy
                /sbin/modprobe $vnet
                [ "$?" -eq 0 ] && ok || fail
                vHubNr=0
-               while [ $vHubNr -lt 8 ]; do
+               while [ $vHubNr -lt 9 ]; do
                        eval 'interface="$VNET_'"$vHubNr"'_INTERFACE"'
                        eval 'hostaddr="$VNET_'"$vHubNr"'_HOSTONLY_HOSTADDR"'
                        eval 'netmask="$VNET_'"$vHubNr"'_HOSTONLY_NETMASK"'
                        if [ -n "$interface" ]; then
+                               vmware_create_vmnet "$vHubNr"
                                # Connect a physical host ethernet interface to a virtual ethernet hub
                                msg_starting 'Bridged networking on /dev/vmnet'"$vHubNr"
                                busy
@@ -308,10 +323,11 @@ case "$1" in
                                  -d /var/run/"$bridge"-"$vHubNr".pid /dev/vmnet"$vHubNr" "$interface"
                                [ "$?" -eq 0 ] && ok || fail
                        elif [ -n "$hostaddr" -a -n "$netmask" ]; then
+                               vmware_create_vmnet "$vHubNr"
                                eval 'samba="$VNET_'"$vHubNr"'_SAMBA"'
                                msg_starting 'Host-only networking on /dev/vmnet'"$vHubNr"
                                busy
-                               daemon vmware_start_hostonly "$vHubNr" 'vmnet'"$vHubNr" "$hostaddr" \
+                               vmware_start_hostonly "$vHubNr" 'vmnet'"$vHubNr" "$hostaddr" \
                                  "$netmask" 'yes' "$samba"
                                [ "$?" -eq 0 ] && ok || fail
                                eval 'nat="$VNET_'"$vHubNr"'_NAT"'
@@ -322,7 +338,7 @@ case "$1" in
                                        cd "$VM_BINDIR" && "$VM_BINDIR"/"$natd" \
                                          -d /var/run/"$natd"-"$vHubNr".pid \
                                          -m /var/run/"$natd"-"$vHubNr".mac \
-                                         -c "$vmware_etc_dir"/vmnet"$vHubNr"/nat/nat.conf
+                                         -c "$vmware_etc_dir"/vmnet"$vHubNr"/nat/nat.conf >/dev/null 2>&1
                                        [ "$?" -eq 0 ] && ok || fail
                                fi
                        fi
@@ -340,7 +356,7 @@ case "$1" in
        fi
        if [ ! -f /var/lock/subsys/"$subsys" ]; then
                msg_not_running "VMware Workstation networking"
-       fi      
+       fi
        # Try to unload parport_pc. Failure is allowed as it does not exist
        # on kernels 2.0, and some other process could be using it.
        /sbin/modprobe -r parport_pc >/dev/null 2>&1
@@ -348,7 +364,7 @@ case "$1" in
                # NB: must kill off processes using vmnet before
                #     unloading module
                vHubNr=0
-               while [ $vHubNr -lt 8 ]; do
+               while [ $vHubNr -lt 9 ]; do
                        eval 'interface="$VNET_'"$vHubNr"'_INTERFACE"'
                        eval 'hostaddr="$VNET_'"$vHubNr"'_HOSTONLY_HOSTADDR"'
                        eval 'netmask="$VNET_'"$vHubNr"'_HOSTONLY_NETMASK"'
@@ -393,6 +409,12 @@ case "$1" in
                        fi
                        vHubNr=$(($vHubNr + 1))
                done
+               msg_stopping 'Virtual machine monitor'
+               busy
+               if /sbin/lsmod | grep -q ^"$driver"; then
+                       /sbin/rmmod "$driver"
+               fi
+               [ "$?" -eq "0" ] && ok || fail
                msg_stopping 'Virtual ethernet'
                busy
                if /sbin/lsmod | grep -q ^"$vnet"; then
This page took 0.086927 seconds and 4 git commands to generate.