Changeset 43656 in vbox for trunk/src/VBox/Installer
- Timestamp:
- Oct 16, 2012 3:18:28 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 81422
- Location:
- trunk/src/VBox/Installer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/darwin/VirtualBox/VBoxAutostartDarwin.sh
r42384 r43656 18 18 # 19 19 20 function vboxStart AllUserVms()20 function vboxStartStopAllUserVms() 21 21 { 22 22 # Go through the list and filter out all users without a shell and a … … 34 34 fi 35 35 36 # Start the daemon 37 su ${user} -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --start --background --config ${1}" 38 36 case "${1}" in 37 start) 38 # Start the daemon 39 su ${user} -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --start --background --config ${CONFIG}" 40 ;; 41 stop) 42 # Start the daemon 43 su ${user} -c "/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart --quiet --stop --config ${CONFIG}" 44 ;; 45 *) 46 echo "Usage: start|stop" 47 exit 1 48 esac 39 49 done 40 50 } 41 51 42 case $1 in 43 --start) vboxStartAllUserVms ${2};; 44 *) echo "Unknown option ${1}";;45 esac 52 function vboxStopAllUserVms() 53 { 54 vboxStartStopAllUserVms "stop" 55 } 46 56 57 CONFIG=${1} 58 vboxStartStopAllUserVms "start" 59 trap vboxStopAllUserVms HUP KILL TERM 60 61 -
trunk/src/VBox/Installer/darwin/VirtualBox/org.virtualbox.vboxautostart.plist
r42384 r43656 12 12 <array> 13 13 <string>/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostartDarwin.sh</string> 14 <string>--start</string>15 14 <string>/etc/vbox/autostart.cfg</string> 16 15 </array> -
trunk/src/VBox/Installer/linux/vboxautostart-service.sh
r43365 r43656 291 291 [ -z "$VBOXAUTOSTART_CONFIG" ] && exit 0 292 292 293 exit 0 294 295 #begin_msg "Stopping VirtualBox VMs configured for autostop"; 296 #vboxdrvrunning || { 297 # fail_msg "VirtualBox kernel module not loaded!" 298 # exit 0 299 #} 300 #PARAMS="--stop" 301 #[ -n "$VBOXAUTOSTART_CONFIG" ] && PARAMS="$PARAMS -c $VBOXAUTOSTART_CONFIG" 293 PARAMS="--stop --config $VBOXAUTOSTART_CONFIG" 302 294 303 295 # prevent inheriting this setting to VBoxSVC 304 #unset VBOX_RELEASE_LOG_DEST305 306 #for user in `ls $VBOXAUTOSTART_DB/*.stop`307 #do308 #start_daemon `basename $user | sed -ne "s/\(.*\).stop/\1/p"` $binary $PARAMS > /dev/null 2>&1309 #done310 311 #return $RETVAL296 unset VBOX_RELEASE_LOG_DEST 297 298 for user in `ls $VBOXAUTOSTART_DB/*.stop` 299 do 300 start_daemon `basename $user | sed -ne "s/\(.*\).stop/\1/p"` $binary $PARAMS > /dev/null 2>&1 301 done 302 303 return $RETVAL 312 304 } 313 305 -
trunk/src/VBox/Installer/solaris/smf-vboxautostart.sh
r42491 r43656 65 65 ;; 66 66 stop) 67 # Kill service contract 68 smf_kill_contract $2 TERM 1 67 if [ ! -x /opt/VirtualBox/VBoxAutostart ]; then 68 echo "ERROR: /opt/VirtualBox/VBoxAutostart does not exist." 69 return $SMF_EXIT_ERR_CONFIG 70 fi 71 72 if [ ! -f /opt/VirtualBox/VBoxAutostart ]; then 73 echo "ERROR: /opt/VirtualBox/VBoxAutostart does not exist." 74 return $SMF_EXIT_ERR_CONFIG 75 fi 76 77 # Get svc configuration 78 VW_CONFIG=`/usr/bin/svcprop -p config/config $SMF_FMRI 2>/dev/null` 79 [ $? != 0 ] && VW_CONFIG= 80 VW_ROTATE=`/usr/bin/svcprop -p config/logrotate $SMF_FMRI 2>/dev/null` 81 [ $? != 0 ] && VW_ROTATE= 82 VW_LOGSIZE=`/usr/bin/svcprop -p config/logsize $SMF_FMRI 2>/dev/null` 83 [ $? != 0 ] && VW_LOGSIZE= 84 VW_LOGINTERVAL=`/usr/bin/svcprop -p config/loginterval $SMF_FMRI 2>/dev/null` 85 [ $? != 0 ] && VW_LOGINTERVAL= 86 87 # Provide sensible defaults 88 [ -z "$VW_CONFIG" ] && VW_CONFIG=/etc/vbox/autostart.cfg 89 [ -z "$VW_ROTATE" ] && VW_ROTATE=10 90 [ -z "$VW_LOGSIZE" ] && VW_LOGSIZE=104857600 91 [ -z "$VW_LOGINTERVAL" ] && VW_LOGINTERVAL=86400 92 93 # Get all users 94 for VW_USER in `logins -g staff` 95 do 96 exec su - "$VW_USER" -c "/opt/VirtualBox/VBoxAutostart --stop --config \"$VW_CONFIG\" --logrotate \"$VW_ROTATE\" --logsize \"$VW_LOGSIZE\" --loginterval \"$VW_LOGINTERVAL\"" 97 98 VW_EXIT=$? 99 if [ $VW_EXIT != 0 ]; then 100 echo "VBoxAutostart failed with $VW_EXIT." 101 VW_EXIT=1 102 break 103 fi 104 done 69 105 ;; 70 106 *) -
trunk/src/VBox/Installer/solaris/virtualbox-autostart.xml
r43653 r43656 71 71 type='method' 72 72 name='stop' 73 exec=' :kill'74 timeout_seconds=' 15'>73 exec='/opt/VirtualBox/smf-vboxautostart.sh %m' 74 timeout_seconds='0'> 75 75 <method_context> 76 76 <method_credential user='root' group='root' />
Note:
See TracChangeset
for help on using the changeset viewer.