Changeset 32251 in vbox for trunk/src/VBox
- Timestamp:
- Sep 6, 2010 2:38:46 PM (14 years ago)
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/debian/postinst.in
r32237 r32251 178 178 if [ -x "/etc/init.d/vboxweb-service" ]; then 179 179 update-rc.d vboxweb-service defaults >/dev/null 180 #if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then181 #invoke-rc.d vboxweb-service start || exit $?182 #else183 #/etc/init.d/vboxweb-service start || exit $?184 #fi180 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 185 185 fi 186 186 -
trunk/src/VBox/Installer/linux/debian/preinst.in
r32008 r32251 1 #!/bin/bash -e1 #!/bin/bash 2 2 # 3 3 # Copyright (C) 2006-2010 Oracle Corporation … … 27 27 28 28 # 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 34 45 fi 35 46 -
trunk/src/VBox/Installer/linux/debian/prerm.in
r32183 r32251 33 33 34 34 # 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 40 42 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 42 53 fi 43 54 fi -
trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
r32237 r32251 145 145 146 146 # 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 147 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 148 if [ -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 152 159 fi 153 160 … … 305 312 %preun 306 313 # 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 314 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 315 if [ -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 312 325 fi 313 326 -
trunk/src/VBox/Installer/linux/vboxweb-service.sh.in
r31794 r32251 127 127 if [ "$system" = "debian" ]; then 128 128 daemon() { 129 start-stop-daemon -- chuid "$VBOXWEB_USER" --start --exec $1 -- $2129 start-stop-daemon --background --chuid "$1" --start --exec $2 -- $3 130 130 } 131 131 killproc() { … … 148 148 . /sbin/functions.sh 149 149 daemon() { 150 start-stop-daemon --start --exec $ 1 -- $2150 start-stop-daemon --start --exec $2 -- $3 151 151 } 152 152 killproc() { … … 174 174 daemon() { 175 175 $@ 176 test $? -eq 0 && add_daemon rc.`basename $ 1`176 test $? -eq 0 && add_daemon rc.`basename $2` 177 177 } 178 178 killproc() { … … 195 195 if [ "$system" = "slackware" ]; then 196 196 daemon() { 197 $ 1 $2197 $2 $3 198 198 } 199 199 killproc() { … … 217 217 . /etc/rc.d/init.d/functions 218 218 daemon() { 219 loadproc $ 1 $2219 loadproc $2 $3 220 220 } 221 221 if [ -n "$NOLSB" ]; then … … 269 269 [ -n "$VBOXWEB_KEEPALIVE" ] && PARAMS="$PARAMS -k $VBOXWEB_KEEPALIVE" 270 270 [ -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 274 276 succ_msg 275 277 fi … … 280 282 if test -f $PIDFILE; then 281 283 begin_msg "Stopping VirtualBox web service"; 282 vboxdrvrunning || {283 fail_msg "VirtualBox kernel module not loaded!"284 exit 0285 }286 284 killproc $binary 287 285 RETVAL=$? 288 test $RETVAL -eq 0 && rm -f $PIDFILE 286 if ! pidof $binary > /dev/null 2>&1; then 287 rm -f $PIDFILE 288 fi 289 289 succ_msg 290 290 fi
Note:
See TracChangeset
for help on using the changeset viewer.