Changeset 32470 in vbox
- Timestamp:
- Sep 14, 2010 10:18:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/vboxweb-service.sh.in
r32388 r32470 90 90 . /etc/init.d/functions 91 91 if [ -n "$NOLSB" ]; then 92 start_daemon() { 93 daemon --user $1 $2 $3 94 } 92 95 fail_msg() { 93 96 echo_failure … … 106 109 if [ "$system" = "suse" ]; then 107 110 . /etc/rc.status 108 daemon() { 109 startproc ${1+"$@"} 111 start_daemon() { 112 usr="$1" 113 shift 114 startproc -u "$usr" $@ 110 115 } 111 116 if [ -n "$NOLSB" ]; then … … 125 130 126 131 if [ "$system" = "debian" ]; then 127 daemon() { 128 start-stop-daemon --background --chuid "$1" --start --exec $2 -- $3 132 start_daemon() { 133 usr="$1" 134 shift 135 bin="$1" 136 shift 137 start-stop-daemon --background --chuid "$usr" --start --exec "$bin" -- $@ 129 138 } 130 139 killproc() { … … 146 155 if [ "$system" = "gentoo" ]; then 147 156 . /sbin/functions.sh 148 daemon() { 149 start-stop-daemon --start --exec $2 -- $3 157 start_daemon() { 158 usr="$1" 159 shift 160 bin="$1" 161 shift 162 start-stop-daemon --background --chuid "$usr" --start --exec "$bin" -- $@ 150 163 } 151 164 killproc() { … … 171 184 USECOLOR=yes 172 185 . /etc/rc.d/functions 173 daemon() {186 start_daemon() { 174 187 $@ 175 188 test $? -eq 0 && add_daemon rc.`basename $2` … … 193 206 194 207 if [ "$system" = "slackware" ]; then 195 daemon() {196 $2 $3197 }198 208 killproc() { 199 209 killall $1 … … 211 221 } 212 222 fi 223 start_daemon() { 224 # runuser 225 fail_msg "not supported on Slackware!" 226 return 227 $2 $3 228 } 213 229 fi 214 230 215 231 if [ "$system" = "lfs" ]; then 216 232 . /etc/rc.d/init.d/functions 217 daemon() { 233 if [ -n "$NOLSB" ]; then 234 fail_msg() { 235 echo_failure 236 } 237 succ_msg() { 238 echo_ok 239 } 240 begin_msg() { 241 echo $1 242 } 243 fi 244 start_daemon() { 245 # runuser 246 fail_msg "not supported on LFS!" 247 return 218 248 loadproc $2 $3 219 249 } 220 if [ -n "$NOLSB" ]; then221 fail_msg() {222 echo_failure223 }224 succ_msg() {225 echo_ok226 }227 begin_msg() {228 echo $1229 }230 fi231 250 status() { 232 251 statusproc $1 … … 250 269 vboxdrvrunning() { 251 270 lsmod | grep -q "vboxdrv[^_-]" 271 } 272 273 check_single_user() { 274 if [ -n "$2" ]; then 275 fail_msg "VBOXWEB_USER must not contain multiple users!" 276 exit 1 277 fi 252 278 } 253 279 … … 256 282 [ -z "$VBOXWEB_USER" ] && exit 0 257 283 begin_msg "Starting VirtualBox web service"; 284 check_single_user $VBOXWEB_USER 258 285 vboxdrvrunning || { 259 286 fail_msg "VirtualBox kernel module not loaded!" … … 268 295 [ -n "$VBOXWEB_KEEPALIVE" ] && PARAMS="$PARAMS -k $VBOXWEB_KEEPALIVE" 269 296 [ -n "$VBOXWEB_LOGFILE" ] && PARAMS="$PARAMS -F $VBOXWEB_LOGFILE" 270 for u in $VBOXWEB_USER; do 271 daemon $u $binary $PARAMS > /dev/null 2>&1 272 done 297 start_daemon $VBOXWEB_USER $binary $PARAMS > /dev/null 2>&1 273 298 PID=`pidof $binary 2>/dev/null` 274 299 [ -n "$PID" ] && echo "$PID" > $PIDFILE
Note:
See TracChangeset
for help on using the changeset viewer.