Changeset 57945 in vbox
- Timestamp:
- Sep 29, 2015 3:21:38 PM (9 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd-service.sh
r57732 r57945 27 27 28 28 PATH=$PATH:/bin:/sbin:/usr/sbin 29 SCRIPTNAME=vboxadd-service 29 30 30 system=unknown 31 if [ -f /etc/redhat-release ]; then 32 system=redhat 33 PIDFILE="/var/lock/subsys/vboxadd-service" 34 elif [ -f /etc/SuSE-release ]; then 35 system=suse 36 PIDFILE="/var/run/vboxadd-service" 37 elif [ -f /etc/debian_version ]; then 38 system=debian 39 PIDFILE="/var/run/vboxadd-service.pid" 40 elif [ -f /etc/gentoo-release ]; then 41 system=gentoo 42 PIDFILE="/var/run/vboxadd-service" 43 elif [ -f /etc/slackware-version ]; then 44 system=slackware 45 PIDFILE="/var/run/vboxadd-service" 46 elif [ -f /etc/lfs-release ]; then 47 system=lfs 48 PIDFILE="/var/run/vboxadd-service.pid" 49 else 50 system=other 51 if [ -d /var/run -a -w /var/run ]; then 52 PIDFILE="/var/run/vboxadd-service" 53 fi 31 PIDFILE="/var/run/${SCRIPTNAME}" 32 33 # Preamble for Gentoo 34 if [ "`which $0`" = "/sbin/rc" ]; then 35 shift 54 36 fi 55 37 56 if [ "$system" = "redhat" ]; then 57 . /etc/init.d/functions 58 fail_msg() { 59 echo_failure 60 echo 61 } 38 begin() 39 { 40 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 41 logger "${SCRIPTNAME}: ${1}." 42 } 62 43 63 succ_msg() { 64 echo_success 65 echo66 44 succ_msg() 45 { 46 logger "${SCRIPTNAME}: done." 47 } 67 48 68 begin() { 69 echo -n "$1" 70 } 71 fi 49 fail_msg() 50 { 51 echo "${SCRIPTNAME}: failed." >&2 52 logger "${SCRIPTNAME}: failed." 53 } 72 54 73 if [ "$system" = "suse" ]; then 74 . /etc/rc.status 75 daemon() { 76 startproc ${1+"$@"} 77 } 55 daemon() { 56 $1 $2 $3 57 } 78 58 79 fail_msg() {80 rc_failed181 rc_status -v82 59 killproc() { 60 killall $1 61 rm -f $PIDFILE 62 } 83 63 84 succ_msg() { 85 rc_reset 86 rc_status -v 87 } 88 89 begin() { 90 echo -n "$1" 91 } 92 fi 93 94 if [ "$system" = "debian" ]; then 64 if which start-stop-daemon >/dev/null; then 95 65 daemon() { 96 66 start-stop-daemon --start --exec $1 -- $2 $3 … … 99 69 killproc() { 100 70 start-stop-daemon --stop --retry 2 --exec $@ 101 }102 103 fail_msg() {104 echo " ...fail!"105 }106 107 succ_msg() {108 echo " ...done."109 }110 111 begin() {112 echo -n "$1"113 }114 fi115 116 if [ "$system" = "gentoo" ]; then117 if [ -f /sbin/functions.sh ]; then118 . /sbin/functions.sh119 elif [ -f /etc/init.d/functions.sh ]; then120 . /etc/init.d/functions.sh121 fi122 daemon() {123 start-stop-daemon --start --exec $1 -- $2 $3124 }125 126 killproc() {127 start-stop-daemon --stop --retry 2 --exec $@128 }129 130 fail_msg() {131 echo " ...fail!"132 }133 134 succ_msg() {135 echo " ...done."136 }137 138 begin() {139 echo -n "$1"140 }141 142 if [ "`which $0`" = "/sbin/rc" ]; then143 shift144 fi145 fi146 147 if [ "$system" = "slackware" -o "$system" = "other" ]; then148 daemon() {149 $1 $2 $3150 }151 152 killproc() {153 killall $1154 rm -f $PIDFILE155 }156 157 fail_msg() {158 echo " ...fail!"159 }160 161 succ_msg() {162 echo " ...done."163 }164 165 begin() {166 echo -n "$1"167 }168 169 fi170 171 if [ "$system" = "lfs" ]; then172 . /etc/rc.d/init.d/functions173 daemon() {174 loadproc $1 $2 $3175 }176 177 fail_msg() {178 echo_failure179 }180 181 succ_msg() {182 echo_ok183 }184 185 begin() {186 echo $1187 }188 189 status() {190 statusproc $1191 71 } 192 72 fi … … 207 87 start() { 208 88 if ! test -f $PIDFILE; then 209 begin "Starting VirtualBox Guest Addition service " ;89 begin "Starting VirtualBox Guest Addition service " console; 210 90 vboxaddrunning || { 211 91 echo "VirtualBox Additions module not loaded!" … … 222 102 stop() { 223 103 if test -f $PIDFILE; then 224 begin "Stopping VirtualBox Guest Addition service " ;104 begin "Stopping VirtualBox Guest Addition service " console; 225 105 killproc $binary 226 106 RETVAL=$? -
trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh
r56860 r57945 33 33 CONFIG_DIR="/var/lib/VBoxGuestAdditions" 34 34 CONFIG="config" 35 SCRIPTNAME=vboxadd-x11 35 36 36 37 # Check architecture … … 69 70 /usr/X11R6/lib/X11/XF86Config" 70 71 71 if [ -f /etc/redhat-release ]; then 72 system=redhat 73 elif [ -f /etc/debian_version ]; then 74 system=debian 75 elif [ -f /etc/SuSE-release ]; then 76 system=suse 77 elif [ -f /etc/gentoo-release ]; then 78 system=gentoo 79 elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then 80 system=lfs 81 else 82 system=other 72 # Preamble for Gentoo 73 if [ "`which $0`" = "/sbin/rc" ]; then 74 shift 83 75 fi 84 76 85 if [ "$system" = "redhat" ]; then 86 . /etc/init.d/functions 87 fail_msg() { 88 echo_failure 89 echo 90 } 91 succ_msg() { 92 echo_success 93 echo 94 } 95 begin() { 96 echo -n "$1" 97 } 98 fi 99 100 if [ "$system" = "suse" ]; then 101 . /etc/rc.status 102 fail_msg() { 103 rc_failed 1 104 rc_status -v 105 } 106 succ_msg() { 107 rc_reset 108 rc_status -v 109 } 110 begin() { 111 echo -n "$1" 112 } 113 fi 114 115 if [ "$system" = "gentoo" ]; then 116 if [ -f /sbin/functions.sh ]; then 117 . /sbin/functions.sh 118 elif [ -f /etc/init.d/functions.sh ]; then 119 . /etc/init.d/functions.sh 120 fi 121 fail_msg() { 122 eend 1 123 } 124 succ_msg() { 125 eend $? 126 } 127 begin() { 128 ebegin $1 129 } 130 if [ "`which $0`" = "/sbin/rc" ]; then 131 shift 132 fi 133 fi 134 135 if [ "$system" = "lfs" ]; then 136 . /etc/rc.d/init.d/functions 137 fail_msg() { 138 echo_failure 139 } 140 succ_msg() { 141 echo_ok 142 } 143 begin() { 144 echo $1 145 } 146 fi 147 148 if [ "$system" = "debian" -o "$system" = "other" ]; then 149 fail_msg() { 150 echo " ...fail!" 151 } 152 succ_msg() { 153 echo " ...done." 154 } 155 begin() { 156 echo -n $1 157 } 158 fi 77 begin() 78 { 79 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 80 logger "${SCRIPTNAME}: ${1}." 81 } 82 83 succ_msg() 84 { 85 logger "${SCRIPTNAME}: done." 86 } 87 88 fail_msg() 89 { 90 echo "${SCRIPTNAME}: failed." >&2 91 logger "${SCRIPTNAME}: failed." 92 } 159 93 160 94 dev=/dev/vboxguest … … 165 99 fail() 166 100 { 167 if [ "$system" = "gentoo" ]; then 168 eerror $1 169 exit 1 170 fi 171 fail_msg 172 echo "($1)" 101 echo "${SCRIPTNAME}: failed: ${1}." >&2 102 logger "${SCRIPTNAME}: ${1}." 173 103 exit 1 174 104 } -
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r57589 r57945 34 34 MODPROBE=/sbin/modprobe 35 35 OLDMODULES="vboxguest vboxadd vboxsf vboxvfs vboxvideo" 36 SCRIPTNAME=vboxadd 36 37 37 38 if $MODPROBE -c 2>/dev/null | grep -q '^allow_unsupported_modules *0'; then … … 58 59 done 59 60 60 if [ -f /etc/redhat-release ]; then 61 system=redhat 62 elif [ -f /etc/SuSE-release ]; then 63 system=suse 64 elif [ -f /etc/gentoo-release ]; then 65 system=gentoo 66 elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then 67 system=lfs 68 else 69 system=other 61 # Preamble for Gentoo 62 if [ "`which $0`" = "/sbin/rc" ]; then 63 shift 70 64 fi 71 65 72 if [ "$system" = "redhat" ]; then 73 . /etc/init.d/functions 74 fail_msg() { 75 echo_failure 76 echo 77 } 78 succ_msg() { 79 echo_success 80 echo 81 } 82 begin() { 83 echo -n "$1" 84 } 85 fi 86 87 if [ "$system" = "suse" ]; then 88 . /etc/rc.status 89 fail_msg() { 90 rc_failed 1 91 rc_status -v 92 } 93 succ_msg() { 94 rc_reset 95 rc_status -v 96 } 97 begin() { 98 echo -n "$1" 99 } 100 fi 101 102 if [ "$system" = "gentoo" ]; then 103 if [ -f /sbin/functions.sh ]; then 104 . /sbin/functions.sh 105 elif [ -f /etc/init.d/functions.sh ]; then 106 . /etc/init.d/functions.sh 107 fi 108 fail_msg() { 109 eend 1 110 } 111 succ_msg() { 112 eend $? 113 } 114 begin() { 115 ebegin $1 116 } 117 if [ "`which $0`" = "/sbin/rc" ]; then 118 shift 119 fi 120 fi 121 122 if [ "$system" = "lfs" ]; then 123 . /etc/rc.d/init.d/functions 124 fail_msg() { 125 echo_failure 126 } 127 succ_msg() { 128 echo_ok 129 } 130 begin() { 131 echo $1 132 } 133 fi 134 135 if [ "$system" = "other" ]; then 136 fail_msg() { 137 echo " ...fail!" 138 } 139 succ_msg() { 140 echo " ...done." 141 } 142 begin() { 143 echo -n $1 144 } 145 fi 66 begin() 67 { 68 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 69 logger "${SCRIPTNAME}: ${1}." 70 } 71 72 succ_msg() 73 { 74 logger "${SCRIPTNAME}: done." 75 } 76 77 fail_msg() 78 { 79 echo "${SCRIPTNAME}: failed." >&2 80 logger "${SCRIPTNAME}: failed." 81 } 146 82 147 83 show_error() 148 84 { 149 if [ "$system" = "gentoo" ]; then 150 eerror $1 151 fi 152 fail_msg 153 echo "($1)" 85 echo "${SCRIPTNAME}: failed: ${1}." >&2 86 logger "${SCRIPTNAME}: ${1}." 154 87 } 155 88 … … 183 116 fi 184 117 printf "\nThe headers for the current running kernel were not found. If the following\nmodule compilation fails then this could be the reason.\n" 185 if [ "$system" = "redhat" ]; then118 if which yum >/dev/null; then 186 119 if echo "$KERN_VER" | grep -q "uek"; then 187 120 printf "The missing package can be probably installed with\nyum install kernel-uek-devel-$KERN_VER\n" … … 189 122 printf "The missing package can be probably installed with\nyum install kernel-devel-$KERN_VER\n" 190 123 fi 191 elif [ "$system" = "suse" ]; then124 elif which zypper >/dev/null; then 192 125 KERN_VER_SUSE=`echo "$KERN_VER" | sed 's/.*-\([^-]*\)/\1/g'` 193 126 KERN_VER_BASE=`echo "$KERN_VER" | sed 's/\(.*\)-[^-]*/\1/g'` 194 127 printf "The missing package can be probably installed with\nzypper install kernel-$KERN_VER_SUSE-devel-$KERN_VER_BASE\n" 195 elif [ "$system" = "debian" ]; then128 elif which apt-get >/dev/null; then 196 129 printf "The missing package can be probably installed with\napt-get install linux-headers-$KERN_VER\n" 197 130 fi … … 268 201 start() 269 202 { 270 begin "Starting the VirtualBox Guest Additions ";203 begin "Starting the VirtualBox Guest Additions" console; 271 204 uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null && 272 205 ps -A -o comm | grep -q '/*udevd$' 2>/dev/null || … … 318 251 stop() 319 252 { 320 begin "Stopping VirtualBox Additions ";253 begin "Stopping VirtualBox Additions" console; 321 254 if ! umount -a -t vboxsf 2>/dev/null; then 322 255 fail "Cannot unmount vboxsf folders" -
trunk/src/VBox/Installer/linux/vboxautostart-service.sh
r56860 r57945 27 27 28 28 PATH=$PATH:/bin:/sbin:/usr/sbin 29 SCRIPTNAME=vboxautostart-service 29 30 30 31 [ -f /etc/debian_release -a -f /lib/lsb/init-functions ] || NOLSB=yes … … 43 44 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 44 45 45 system=unknown 46 if [ -f /etc/redhat-release ]; then 47 system=redhat 48 elif [ -f /etc/SuSE-release ]; then 49 system=suse 50 elif [ -f /etc/debian_version ]; then 51 system=debian 52 elif [ -f /etc/gentoo-release ]; then 53 system=gentoo 54 elif [ -f /etc/slackware-version ]; then 55 system=slackware 56 elif [ -f /etc/lfs-release ]; then 57 system=lfs 58 else 59 system=other 46 # Preamble for Gentoo 47 if [ "`which $0`" = "/sbin/rc" ]; then 48 shift 60 49 fi 61 50 62 if [ -z "$NOLSB" ]; then 63 . /lib/lsb/init-functions 64 fail_msg() { 65 echo "" 66 log_failure_msg "$1" 67 } 68 succ_msg() { 69 log_success_msg " done." 70 } 71 begin_msg() { 72 log_daemon_msg "$@" 73 } 74 fi 51 begin_msg() 52 { 53 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 54 logger "${SCRIPTNAME}: ${1}." 55 } 75 56 76 if [ "$system" = "redhat" ]; then 77 . /etc/init.d/functions 78 if [ -n "$NOLSB" ]; then 79 start_daemon() { 80 usr="$1" 81 shift 82 daemon --user $usr $@ 83 } 84 fail_msg() { 85 echo_failure 86 echo 87 } 88 succ_msg() { 89 echo_success 90 echo 91 } 92 begin_msg() { 93 echo -n "$1" 94 } 95 fi 96 fi 57 succ_msg() 58 { 59 logger "${SCRIPTNAME}: done." 60 } 97 61 98 if [ "$system" = "suse" ]; then 99 . /etc/rc.status 100 start_daemon() { 101 usr="$1" 102 shift 103 su - $usr -c "$*" 104 } 105 if [ -n "$NOLSB" ]; then 106 fail_msg() { 107 rc_failed 1 108 rc_status -v 109 } 110 succ_msg() { 111 rc_reset 112 rc_status -v 113 } 114 begin_msg() { 115 echo -n "$1" 116 } 117 fi 118 fi 62 fail_msg() 63 { 64 echo "${SCRIPTNAME}: failed: ${1}." >&2 65 logger "${SCRIPTNAME}: failed: ${1}." 66 } 119 67 120 if [ "$system" = "debian" ]; then 68 start_daemon() { 69 usr="$1" 70 shift 71 su - $usr -c "$*" 72 } 73 74 if which start-stop-daemon >/dev/null; then 121 75 start_daemon() { 122 76 usr="$1" … … 126 80 start-stop-daemon --background --chuid $usr --start --exec $bin -- $@ 127 81 } 128 killproc() {129 start-stop-daemon --stop --exec $@130 }131 if [ -n "$NOLSB" ]; then132 fail_msg() {133 echo " ...fail!"134 }135 succ_msg() {136 echo " ...done."137 }138 begin_msg() {139 echo -n "$1"140 }141 fi142 fi143 144 if [ "$system" = "gentoo" ]; then145 if [ -f /sbin/functions.sh ]; then146 . /sbin/functions.sh147 elif [ -f /etc/init.d/functions.sh ]; then148 . /etc/init.d/functions.sh149 fi150 start_daemon() {151 usr="$1"152 shift153 bin="$1"154 shift155 start-stop-daemon --background --chuid $usr --start --exec $bin -- $@156 }157 killproc() {158 start-stop-daemon --stop --exec $@159 }160 if [ -n "$NOLSB" ]; then161 fail_msg() {162 echo " ...fail!"163 }164 succ_msg() {165 echo " ...done."166 }167 begin_msg() {168 echo -n "$1"169 }170 if [ "`which $0`" = "/sbin/rc" ]; then171 shift172 fi173 fi174 fi175 176 if [ "$system" = "slackware" ]; then177 killproc() {178 killall $1179 rm -f $PIDFILE180 }181 if [ -n "$NOLSB" ]; then182 fail_msg() {183 echo " ...fail!"184 }185 succ_msg() {186 echo " ...done."187 }188 begin_msg() {189 echo -n "$1"190 }191 fi192 start_daemon() {193 usr="$1"194 shift195 su - $usr -c "$*"196 }197 fi198 199 if [ "$system" = "lfs" ]; then200 . /etc/rc.d/init.d/functions201 if [ -n "$NOLSB" ]; then202 fail_msg() {203 echo_failure204 }205 succ_msg() {206 echo_ok207 }208 begin_msg() {209 echo $1210 }211 fi212 start_daemon() {213 usr="$1"214 shift215 su - $usr -c "$*"216 }217 status() {218 statusproc $1219 }220 fi221 222 if [ "$system" = "other" ]; then223 if [ -n "$NOLSB" ]; then224 fail_msg() {225 echo " ...fail!"226 }227 succ_msg() {228 echo " ...done."229 }230 begin_msg() {231 echo -n "$1"232 }233 fi234 82 fi 235 83 … … 241 89 [ -z "$VBOXAUTOSTART_DB" ] && exit 0 242 90 [ -z "$VBOXAUTOSTART_CONFIG" ] && exit 0 243 begin_msg "Starting VirtualBox VMs configured for autostart" ;91 begin_msg "Starting VirtualBox VMs configured for autostart" console; 244 92 vboxdrvrunning || { 245 93 fail_msg "VirtualBox kernel module not loaded!" -
trunk/src/VBox/Installer/linux/vboxballoonctrl-service.sh
r56860 r57945 27 27 28 28 PATH=$PATH:/bin:/sbin:/usr/sbin 29 30 [ -f /lib/lsb/init-functions -a -f /etc/debian_release ] || NOLSB=yes 29 SCRIPTNAME=vboxballoonctrl-service 30 31 31 [ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg 32 32 … … 43 43 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 44 44 45 system=unknown 46 if [ -f /etc/redhat-release ]; then 47 system=redhat 48 PIDFILE="/var/lock/subsys/vboxballoonctrl-service" 49 elif [ -f /etc/SuSE-release ]; then 50 system=suse 51 PIDFILE="/var/lock/subsys/vboxballoonctrl-service" 52 elif [ -f /etc/debian_version ]; then 53 system=debian 54 PIDFILE="/var/run/vboxballoonctrl-service" 55 elif [ -f /etc/gentoo-release ]; then 56 system=gentoo 57 PIDFILE="/var/run/vboxballoonctrl-service" 58 elif [ -f /etc/slackware-version ]; then 59 system=slackware 60 PIDFILE="/var/run/vboxballoonctrl-service" 61 elif [ -f /etc/lfs-release ]; then 62 system=lfs 63 PIDFILE="/var/run/vboxballoonctrl-service.pid" 64 else 65 system=other 66 if [ -d /var/run -a -w /var/run ]; then 67 PIDFILE="/var/run/vboxballoonctrl-service" 68 fi 45 PIDFILE="/var/run/${SCRIPTNAME}" 46 47 # Preamble for Gentoo 48 if [ "`which $0`" = "/sbin/rc" ]; then 49 shift 69 50 fi 70 51 71 if [ -z "$NOLSB" ]; then 72 . /lib/lsb/init-functions 73 fail_msg() { 74 echo "" 75 log_failure_msg "$1" 76 } 77 succ_msg() { 78 log_success_msg " done." 79 } 80 begin_msg() { 81 log_daemon_msg "$@" 82 } 83 fi 84 85 if [ "$system" = "redhat" ]; then 86 . /etc/init.d/functions 87 if [ -n "$NOLSB" ]; then 88 start_daemon() { 89 usr="$1" 90 shift 91 daemon --user $usr $@ 92 } 93 fail_msg() { 94 echo_failure 95 echo 96 } 97 succ_msg() { 98 echo_success 99 echo 100 } 101 begin_msg() { 102 echo -n "$1" 103 } 104 fi 105 fi 106 107 if [ "$system" = "suse" ]; then 108 . /etc/rc.status 109 start_daemon() { 110 usr="$1" 111 shift 112 su - $usr -c "$*" 113 } 114 if [ -n "$NOLSB" ]; then 115 fail_msg() { 116 rc_failed 1 117 rc_status -v 118 } 119 succ_msg() { 120 rc_reset 121 rc_status -v 122 } 123 begin_msg() { 124 echo -n "$1" 125 } 126 fi 127 fi 128 129 if [ "$system" = "debian" ]; then 52 begin_msg() 53 { 54 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 55 logger "${SCRIPTNAME}: ${1}." 56 } 57 58 succ_msg() 59 { 60 logger "${SCRIPTNAME}: done." 61 } 62 63 fail_msg() 64 { 65 echo "${SCRIPTNAME}: failed: ${1}." >&2 66 logger "${SCRIPTNAME}: failed: ${1}." 67 } 68 69 start_daemon() { 70 usr="$1" 71 shift 72 su - $usr -c "$*" 73 } 74 75 killproc() { 76 killall $1 77 rm -f $PIDFILE 78 } 79 80 if which start-stop-daemon >/dev/null; then 130 81 start_daemon() { 131 82 usr="$1" … … 135 86 start-stop-daemon --background --chuid $usr --start --exec $bin -- $@ 136 87 } 88 137 89 killproc() { 138 90 start-stop-daemon --stop --exec $@ 139 91 } 140 if [ -n "$NOLSB" ]; then141 fail_msg() {142 echo " ...fail!"143 }144 succ_msg() {145 echo " ...done."146 }147 begin_msg() {148 echo -n "$1"149 }150 fi151 fi152 153 if [ "$system" = "gentoo" ]; then154 if [ -f /sbin/functions.sh ]; then155 . /sbin/functions.sh156 elif [ -f /etc/init.d/functions.sh ]; then157 . /etc/init.d/functions.sh158 fi159 start_daemon() {160 usr="$1"161 shift162 bin="$1"163 shift164 start-stop-daemon --background --chuid $usr --start --exec $bin -- $@165 }166 killproc() {167 start-stop-daemon --stop --exec $@168 }169 if [ -n "$NOLSB" ]; then170 fail_msg() {171 echo " ...fail!"172 }173 succ_msg() {174 echo " ...done."175 }176 begin_msg() {177 echo -n "$1"178 }179 if [ "`which $0`" = "/sbin/rc" ]; then180 shift181 fi182 fi183 fi184 185 if [ "$system" = "slackware" ]; then186 killproc() {187 killall $1188 rm -f $PIDFILE189 }190 if [ -n "$NOLSB" ]; then191 fail_msg() {192 echo " ...fail!"193 }194 succ_msg() {195 echo " ...done."196 }197 begin_msg() {198 echo -n "$1"199 }200 fi201 start_daemon() {202 usr="$1"203 shift204 su - $usr -c "$*"205 }206 fi207 208 if [ "$system" = "lfs" ]; then209 . /etc/rc.d/init.d/functions210 if [ -n "$NOLSB" ]; then211 fail_msg() {212 echo_failure213 }214 succ_msg() {215 echo_ok216 }217 begin_msg() {218 echo $1219 }220 fi221 start_daemon() {222 usr="$1"223 shift224 su - $usr -c "$*"225 }226 status() {227 statusproc $1228 }229 fi230 231 if [ "$system" = "other" ]; then232 if [ -n "$NOLSB" ]; then233 fail_msg() {234 echo " ...fail!"235 }236 succ_msg() {237 echo " ...done."238 }239 begin_msg() {240 echo -n "$1"241 }242 fi243 92 fi 244 93 … … 258 107 [ -z "$VBOXWATCHDOG_USER" -a -z "$VBOXBALLOONCTRL_USER" ] && exit 0 259 108 [ -z "$VBOXWATCHDOG_USER" ] && VBOXWATCHDOG_USER="$VBOXBALLOONCTRL_USER" 260 begin_msg "Starting VirtualBox watchdog service" ;109 begin_msg "Starting VirtualBox watchdog service" console; 261 110 check_single_user $VBOXWATCHDOG_USER 262 111 vboxdrvrunning || { … … 303 152 stop() { 304 153 if test -f $PIDFILE; then 305 begin_msg "Stopping VirtualBox watchdog service" ;154 begin_msg "Stopping VirtualBox watchdog service" console; 306 155 killproc $binary 307 156 RETVAL=$? -
trunk/src/VBox/Installer/linux/vboxdrv.sh.in
r57900 r57945 27 27 ### END INIT INFO 28 28 29 ## @todo get rid of the autogeneration, perhaps write "version" and "group" to 30 ## a configuration file in /etc 31 29 32 PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH 30 33 DEVICE=/dev/vboxdrv … … 32 35 VERSION=%VERSION% 33 36 MODPROBE=/sbin/modprobe 37 SCRIPTNAME=vboxdrv 34 38 35 39 if $MODPROBE -c | grep -q '^allow_unsupported_modules *0'; then … … 37 41 fi 38 42 39 [ -f /etc/debian_release -a -f /lib/lsb/init-functions ] || NOLSB=yes40 43 [ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg 41 44 export BUILD_TYPE … … 57 60 [ ! -f /etc/debian_release -o -x $VBOXMANAGE -a -x $BUILDINTMP ] || exit 0 58 61 59 if [ -n "$NOLSB" ]; then 60 if [ -f /etc/redhat-release ]; then 61 system=redhat 62 elif [ -f /etc/SuSE-release ]; then 63 system=suse 64 elif [ -f /etc/gentoo-release ]; then 65 system=gentoo 66 fi 62 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 63 64 # Preamble for Gentoo 65 if [ "`which $0`" = "/sbin/rc" ]; then 66 shift 67 67 fi 68 68 69 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 70 71 if [ -z "$NOLSB" ]; then 72 . /lib/lsb/init-functions 73 fail_msg() { 74 echo "" 75 log_failure_msg "$1" 76 } 77 succ_msg() { 78 log_end_msg 0 79 } 80 begin_msg() { 81 log_daemon_msg "$@" 82 } 83 else 84 if [ "$system" = "redhat" ]; then 85 . /etc/init.d/functions 86 fail_msg() { 87 echo -n " " 88 echo_failure 89 echo 90 echo " ($1)" 91 } 92 succ_msg() { 93 echo -n " " 94 echo_success 95 echo 96 } 97 elif [ "$system" = "suse" ]; then 98 . /etc/rc.status 99 fail_msg() { 100 rc_failed 1 101 rc_status -v 102 echo " ($1)" 103 } 104 succ_msg() { 105 rc_reset 106 rc_status -v 107 } 108 elif [ "$system" = "gentoo" ]; then 109 if [ -f /sbin/functions.sh ]; then 110 . /sbin/functions.sh 111 elif [ -f /etc/init.d/functions.sh ]; then 112 . /etc/init.d/functions.sh 113 fi 114 fail_msg() { 115 eerror "$1" 116 } 117 succ_msg() { 118 eend "$?" 119 } 120 begin_msg() { 121 ebegin "$1" 122 } 123 if [ "`which $0`" = "/sbin/rc" ]; then 124 shift 125 fi 126 else 127 fail_msg() { 128 echo " ...failed!" 129 echo " ($1)" 130 } 131 succ_msg() { 132 echo " ...done." 133 } 134 fi 135 if [ "$system" != "gentoo" ]; then 136 begin_msg() { 137 [ -z "${1:-}" ] && return 1 138 if [ -z "${2:-}" ]; then 139 echo -n "$1" 140 else 141 echo -n "$1: $2" 142 fi 143 } 144 fi 145 fi 69 begin_msg() 70 { 71 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 72 logger "${SCRIPTNAME}: ${1}." 73 } 74 75 succ_msg() 76 { 77 logger "${SCRIPTNAME}: done." 78 } 79 80 fail_msg() 81 { 82 echo "${SCRIPTNAME}: failed: ${1}." >&2 83 logger "${SCRIPTNAME}: failed: ${1}." 84 } 146 85 147 86 failure() … … 158 97 start() 159 98 { 160 begin_msg "Starting VirtualBox kernel modules" 99 begin_msg "Starting VirtualBox kernel modules" console 161 100 if [ -d /proc/xen ]; then 162 101 failure "Running VirtualBox in a Xen environment is not supported" … … 219 158 stop() 220 159 { 221 begin_msg "Stopping VirtualBox kernel modules" 160 begin_msg "Stopping VirtualBox kernel modules" console 222 161 if running vboxpci; then 223 162 if ! rmmod vboxpci 2>/dev/null; then -
trunk/src/VBox/Installer/linux/vboxweb-service.sh
r56860 r57945 27 27 28 28 PATH=$PATH:/bin:/sbin:/usr/sbin 29 30 [ -f /etc/debian_release -a -f /lib/lsb/init-functions ] || NOLSB=yes 29 SCRIPTNAME=vboxweb-service 30 31 31 [ -f /etc/vbox/vbox.cfg ] && . /etc/vbox/vbox.cfg 32 32 … … 45 45 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 46 46 47 system=unknown 48 if [ -f /etc/redhat-release ]; then 49 system=redhat 50 PIDFILE="/var/lock/subsys/vboxweb-service" 51 elif [ -f /etc/SuSE-release ]; then 52 system=suse 53 PIDFILE="/var/lock/subsys/vboxweb-service" 54 elif [ -f /etc/debian_version ]; then 55 system=debian 56 PIDFILE="/var/run/vboxweb-service" 57 elif [ -f /etc/gentoo-release ]; then 58 system=gentoo 59 PIDFILE="/var/run/vboxweb-service" 60 elif [ -f /etc/slackware-version ]; then 61 system=slackware 62 PIDFILE="/var/run/vboxweb-service" 63 elif [ -f /etc/lfs-release ]; then 64 system=lfs 65 PIDFILE="/var/run/vboxweb-service.pid" 66 else 67 system=other 68 if [ -d /var/run -a -w /var/run ]; then 69 PIDFILE="/var/run/vboxweb-service" 70 fi 47 PIDFILE="/var/run/${SCRIPTNAME}" 48 49 # Preamble for Gentoo 50 if [ "`which $0`" = "/sbin/rc" ]; then 51 shift 71 52 fi 72 53 73 if [ -z "$NOLSB" ]; then 74 . /lib/lsb/init-functions 75 fail_msg() { 76 echo "" 77 log_failure_msg "$1" 78 } 79 succ_msg() { 80 log_success_msg " done." 81 } 82 begin_msg() { 83 log_daemon_msg "$@" 84 } 85 fi 86 87 if [ "$system" = "redhat" ]; then 88 . /etc/init.d/functions 89 if [ -n "$NOLSB" ]; then 90 start_daemon() { 91 usr="$1" 92 shift 93 daemon --user $usr $@ 94 } 95 fail_msg() { 96 echo_failure 97 echo 98 } 99 succ_msg() { 100 echo_success 101 echo 102 } 103 begin_msg() { 104 echo -n "$1" 105 } 106 fi 107 fi 108 109 if [ "$system" = "suse" ]; then 110 . /etc/rc.status 111 start_daemon() { 112 usr="$1" 113 shift 114 su - $usr -c "$*" 115 } 116 if [ -n "$NOLSB" ]; then 117 fail_msg() { 118 rc_failed 1 119 rc_status -v 120 } 121 succ_msg() { 122 rc_reset 123 rc_status -v 124 } 125 begin_msg() { 126 echo -n "$1" 127 } 128 fi 129 fi 130 131 if [ "$system" = "debian" ]; then 54 begin_msg() 55 { 56 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 57 logger "${SCRIPTNAME}: ${1}." 58 } 59 60 succ_msg() 61 { 62 logger "${SCRIPTNAME}: done." 63 } 64 65 fail_msg() 66 { 67 echo "${SCRIPTNAME}: failed: ${1}." >&2 68 logger "${SCRIPTNAME}: failed: ${1}." 69 } 70 71 start_daemon() { 72 usr="$1" 73 shift 74 su - $usr -c "$*" 75 } 76 77 killproc() { 78 killall $1 79 rm -f $PIDFILE 80 } 81 82 if which start-stop-daemon >/dev/null; then 132 83 start_daemon() { 133 84 usr="$1" … … 137 88 start-stop-daemon --background --chuid $usr --start --exec $bin -- $@ 138 89 } 90 139 91 killproc() { 140 92 start-stop-daemon --stop --exec $@ 141 93 } 142 if [ -n "$NOLSB" ]; then143 fail_msg() {144 echo " ...fail!"145 }146 succ_msg() {147 echo " ...done."148 }149 begin_msg() {150 echo -n "$1"151 }152 fi153 fi154 155 if [ "$system" = "gentoo" ]; then156 if [ -f /sbin/functions.sh ]; then157 . /sbin/functions.sh158 elif [ -f /etc/init.d/functions.sh ]; then159 . /etc/init.d/functions.sh160 fi161 start_daemon() {162 usr="$1"163 shift164 bin="$1"165 shift166 start-stop-daemon --background --chuid $usr --start --exec $bin -- $@167 }168 killproc() {169 start-stop-daemon --stop --exec $@170 }171 if [ -n "$NOLSB" ]; then172 fail_msg() {173 echo " ...fail!"174 }175 succ_msg() {176 echo " ...done."177 }178 begin_msg() {179 echo -n "$1"180 }181 if [ "`which $0`" = "/sbin/rc" ]; then182 shift183 fi184 fi185 fi186 187 if [ "$system" = "slackware" ]; then188 killproc() {189 killall $1190 rm -f $PIDFILE191 }192 if [ -n "$NOLSB" ]; then193 fail_msg() {194 echo " ...fail!"195 }196 succ_msg() {197 echo " ...done."198 }199 begin_msg() {200 echo -n "$1"201 }202 fi203 start_daemon() {204 usr="$1"205 shift206 su - $usr -c "$*"207 }208 fi209 210 if [ "$system" = "lfs" ]; then211 . /etc/rc.d/init.d/functions212 if [ -n "$NOLSB" ]; then213 fail_msg() {214 echo_failure215 }216 succ_msg() {217 echo_ok218 }219 begin_msg() {220 echo $1221 }222 fi223 start_daemon() {224 usr="$1"225 shift226 su - $usr -c "$*"227 }228 status() {229 statusproc $1230 }231 fi232 233 if [ "$system" = "other" ]; then234 if [ -n "$NOLSB" ]; then235 fail_msg() {236 echo " ...fail!"237 }238 succ_msg() {239 echo " ...done."240 }241 begin_msg() {242 echo -n "$1"243 }244 fi245 94 fi 246 95 … … 259 108 if ! test -f $PIDFILE; then 260 109 [ -z "$VBOXWEB_USER" ] && exit 0 261 begin_msg "Starting VirtualBox web service" ;110 begin_msg "Starting VirtualBox web service" console; 262 111 check_single_user $VBOXWEB_USER 263 112 vboxdrvrunning || { … … 316 165 stop() { 317 166 if test -f $PIDFILE; then 318 begin_msg "Stopping VirtualBox web service" ;167 begin_msg "Stopping VirtualBox web service" console; 319 168 killproc $binary 320 169 RETVAL=$?
Note:
See TracChangeset
for help on using the changeset viewer.