]> git.pld-linux.org Git - packages/VirtualBox-bin.git/commitdiff
- add subsys locking for %post scriptlet AC-branch LINUX_2_6_22 auto/ac/VirtualBox-1_5_6-3 auto/th/VirtualBox-1_5_6-10 auto/th/VirtualBox-1_5_6-11 auto/th/VirtualBox-1_5_6-12 auto/ti/VirtualBox-1_5_6-11 auto/ti/VirtualBox-1_6_0-0_1 auto/ti/VirtualBox-1_6_0-1
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 2 Mar 2008 16:36:00 +0000 (16:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    VirtualBox-vboxdrv.init -> 1.3

VirtualBox-vboxdrv.init

index b40f53c573e1b040c7d2a3eda8d1be78a4e0a3f9..51cd2cf3a437f6ad309f4add1d99f3eea151b6c1 100644 (file)
@@ -19,38 +19,43 @@ VBOX_MODULE="vboxdrv"
 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
 
 start() {
-       modprobe -s $VBOX_MODULE
-       # set proper /dev/vboxdrv for systems with static dev
-       if ! [ -d /dev/.udev/ ]; then
-               show "Setting $VBOX_DEVICE entry"
-               busy
-               rm -f $VBOX_DEVICE
-               VBOX_MAJOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/devices)
-               if [ -n "$VBOX_MAJOR" ]; then
-                       VBOX_MINOR=0
-               else
-                       VBOX_MINOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/misc)
-                       if [ -n "$VBOX_MINOR" ]; then
-                               VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices)
+       if [ ! -f /var/lock/subsys/virtualbox ]; then
+               modprobe -s $VBOX_MODULE
+               # set proper /dev/vboxdrv for systems with static dev
+               if ! [ -d /dev/.udev/ ]; then
+                       show "Setting $VBOX_DEVICE entry"
+                       busy
+                       rm -f $VBOX_DEVICE
+                       VBOX_MAJOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/devices)
+                       if [ -n "$VBOX_MAJOR" ]; then
+                               VBOX_MINOR=0
+                       else
+                               VBOX_MINOR=$(awk '$2 == "vboxdrv" {print $1}' /proc/misc)
+                               if [ -n "$VBOX_MINOR" ]; then
+                                       VBOX_MAJOR=$(awk '$2 == "misc" {print $1}' /proc/devices)
+                               fi
+                       fi
+                       if [ -z "$VBOX_MAJOR" ]; then
+                               /sbin/rmmod $VBOX_MODULE
+                               fail
+                       elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then
+                               rmmod $VBOX_MODNAME
+                               fail
+                       elif ! chown root:vbox $VBOX_DEVICE; then
+                               fail
+                       else
+                               ok
                        fi
                fi
-               if [ -z "$VBOX_MAJOR" ]; then
-                       /sbin/rmmod $VBOX_MODULE
-                       fail
-               elif ! mknod -m 0660 $VBOX_DEVICE c $VBOX_MAJOR $VBOX_MINOR; then
-                       rmmod $VBOX_MODNAME
-                       fail
-               elif ! chown root:vbox $VBOX_DEVICE; then
-                       fail
-               else
-                       ok
-               fi
+
+               touch /var/lock/subsys/virtualbox
        fi
 }
 
 stop() {
        # NOTE: rmmod will wait if device is in use, so automatic rmmod probably not the best idea
        /sbin/rmmod $VBOX_MODULE
+       rm -f /var/lock/subsys/virtualbox
 }
 
 RETVAL=0
This page took 0.071468 seconds and 4 git commands to generate.