VirtualBox

Changeset 32251 in vbox for trunk/src


Ignore:
Timestamp:
Sep 6, 2010 2:38:46 PM (14 years ago)
Author:
vboxsync
Message:

Linux installer: vboxweb-service fixes

Location:
trunk/src/VBox/Installer/linux
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/linux/debian/postinst.in

    r32237 r32251  
    178178  if [ -x "/etc/init.d/vboxweb-service" ]; then
    179179    update-rc.d vboxweb-service defaults >/dev/null
    180 #    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
    181 #        invoke-rc.d vboxweb-service start || exit $?
    182 #    else
    183 #        /etc/init.d/vboxweb-service start || exit $?
    184 #    fi
     180    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     181        invoke-rc.d vboxweb-service start || exit $?
     182    else
     183        /etc/init.d/vboxweb-service start || exit $?
     184    fi
    185185  fi
    186186
  • trunk/src/VBox/Installer/linux/debian/preinst.in

    r32008 r32251  
    1 #!/bin/bash -e
     1#!/bin/bash
    22#
    33# Copyright (C) 2006-2010 Oracle Corporation
     
    2727
    2828  # check for active VMs
    29   if pidof VBoxSVC > /dev/null 2>&1; then
    30     db_fset virtualbox/old-running seen false || true
    31     db_input critical virtualbox/old-running || true
    32     db_go || true
    33     exit 1
     29  VBOXSVC_PID=`pidof VBoxSVC 2> /dev/null || true`
     30  if [ -n "$VBOXSVC_PID" ]; then
     31    # try graceful termination; terminate the webservice first
     32    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     33      invoke-rc.d vboxweb-service stop || true
     34    else
     35      /etc/init.d/vboxweb-service stop || true
     36    fi
     37    kill -USR1 $VBOXSVC_PID
     38    sleep 1
     39    if pidof VBoxSVC > /dev/null 2>&1; then   
     40      db_fset virtualbox/old-running seen false || true
     41      db_input critical virtualbox/old-running || true
     42      db_go || true
     43      exit 1
     44    fi
    3445  fi
    3546
  • trunk/src/VBox/Installer/linux/debian/prerm.in

    r32183 r32251  
    3333
    3434  # check for active VMs
    35   if pidof VBoxSVC > /dev/null 2>&1; then
    36     if [ "$1" != "failed-upgrade" ]; then
    37       db_fset virtualbox/old-running seen false || true
    38       db_input critical virtualbox/old-running || true
    39       db_go || true
     35  VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null`
     36  if [ -n "$VBOXSVC_PID" ]; then
     37    # try graceful termination; terminate the webservice first
     38    if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
     39      invoke-rc.d vboxweb-service stop || true
     40    else
     41      /etc/init.d/vboxweb-service stop || true
    4042    fi
    41     exit 1
     43    kill -USR1 $VBOXSVC_PID
     44    sleep 1
     45    if pidof VBoxSVC > /dev/null 2>&1; then   
     46      if [ "$1" != "failed-upgrade" ]; then
     47        db_fset virtualbox/old-running seen false || true
     48        db_input critical virtualbox/old-running || true
     49        db_go || true
     50      fi
     51      exit 1
     52    fi
    4253  fi
    4354fi
  • trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec

    r32237 r32251  
    145145
    146146# check for active VMs
    147 if pidof VBoxSVC > /dev/null 2>&1; then
    148   echo "A copy of VirtualBox is currently running.  Please close it and try again. Please note"
    149   echo "that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to"
    150   echo "finish running."
    151   exit 1
     147VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
     148if [ -n "$VBOXSVC_PID" ]; then
     149  # try graceful termination; terminate the webservice first
     150  /etc/init.d/vboxweb-service stop || true
     151  kill -USR1 $VBOXSVC_PID
     152  sleep 1
     153  if pidof VBoxSVC > /dev/null 2>&1; then
     154    echo "A copy of VirtualBox is currently running.  Please close it and try again. Please note"
     155    echo "that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to"
     156    echo "finish running."
     157    exit 1
     158  fi
    152159fi
    153160
     
    305312%preun
    306313# check for active VMs
    307 if pidof VBoxSVC > /dev/null 2>&1; then
    308   echo "A copy of VirtualBox is currently running.  Please close it and try again. Please note"
    309   echo "that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to"
    310   echo "finish running."
    311   exit 1
     314VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`
     315if [ -n "$VBOXSVC_PID" ]; then
     316  # try graceful termination; terminate the webservice first
     317  /etc/init.d/vboxweb-service stop || true
     318  sleep 1
     319  if pidof VBoxSVC > /dev/null 2>&1; then
     320    echo "A copy of VirtualBox is currently running.  Please close it and try again. Please note"
     321    echo "that it can take up to ten seconds for VirtualBox (in particular the VBoxSVC daemon) to"
     322    echo "finish running."
     323    exit 1
     324  fi
    312325fi
    313326
  • trunk/src/VBox/Installer/linux/vboxweb-service.sh.in

    r31794 r32251  
    127127if [ "$system" = "debian" ]; then
    128128    daemon() {
    129         start-stop-daemon --chuid "$VBOXWEB_USER" --start --exec $1 -- $2
     129        start-stop-daemon --background --chuid "$1" --start --exec $2 -- $3
    130130    }
    131131    killproc() {
     
    148148    . /sbin/functions.sh
    149149    daemon() {
    150         start-stop-daemon --start --exec $1 -- $2
     150        start-stop-daemon --start --exec $2 -- $3
    151151    }
    152152    killproc() {
     
    174174    daemon() {
    175175        $@
    176         test $? -eq 0 && add_daemon rc.`basename $1`
     176        test $? -eq 0 && add_daemon rc.`basename $2`
    177177    }
    178178    killproc() {
     
    195195if [ "$system" = "slackware" ]; then
    196196    daemon() {
    197         $1 $2
     197        $2 $3
    198198    }
    199199    killproc() {
     
    217217    . /etc/rc.d/init.d/functions
    218218    daemon() {
    219         loadproc $1 $2
     219        loadproc $2 $3
    220220    }
    221221    if [ -n "$NOLSB" ]; then
     
    269269        [ -n "$VBOXWEB_KEEPALIVE" ]      && PARAMS="$PARAMS -k $VBOXWEB_KEEPALIVE"
    270270        [ -n "$VBOXWEB_LOGFILE" ]        && PARAMS="$PARAMS -F $VBOXWEB_LOGFILE"
    271         daemon $binary -b $PARAMS > /dev/null 2>&1
    272         RETVAL=$?
    273         test $RETVAL -eq 0 && echo `pidof VBoxService` > $PIDFILE
     271        for u in $VBOXWEB_USER; do
     272            daemon $u $binary $PARAMS > /dev/null 2>&1
     273        done
     274        PID=`pidof $binary 2>/dev/null`
     275        [ -n "$PID" ] && echo "$PID" > $PIDFILE
    274276        succ_msg
    275277    fi
     
    280282    if test -f $PIDFILE; then
    281283        begin_msg "Stopping VirtualBox web service";
    282         vboxdrvrunning || {
    283             fail_msg "VirtualBox kernel module not loaded!"
    284             exit 0
    285         }
    286284        killproc $binary
    287285        RETVAL=$?
    288         test $RETVAL -eq 0 && rm -f $PIDFILE
     286        if ! pidof $binary > /dev/null 2>&1; then
     287            rm -f $PIDFILE
     288        fi
    289289        succ_msg
    290290    fi
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette