VirtualBox

source: vbox/trunk/src/VBox/Installer/solaris/smf-vboxwebsrv.sh@ 35650

Last change on this file since 35650 was 31171, checked in by vboxsync, 14 years ago

Main/webservice+Installer/solaris: make the max keepalive parameter a command line option and set it higher than the default in the solaris start script

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1#!/sbin/sh
2# $Id: smf-vboxwebsrv.sh 31171 2010-07-28 15:26:54Z vboxsync $
3
4# Copyright (C) 2008-2010 Oracle Corporation
5#
6# This file is part of VirtualBox Open Source Edition (OSE), as
7# available from http://www.virtualbox.org. This file is free software;
8# you can redistribute it and/or modify it under the terms of the GNU
9# General Public License (GPL) as published by the Free Software
10# Foundation, in version 2 as it comes in the "COPYING" file of the
11# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
12# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
13#
14
15#
16# smf-vboxwebsrv method
17#
18# Argument is the method name (start, stop, ...)
19
20. /lib/svc/share/smf_include.sh
21
22VW_OPT="$1"
23VW_EXIT=0
24
25case $VW_OPT in
26 start)
27 if [ ! -x /opt/VirtualBox/vboxwebsrv ]; then
28 echo "ERROR: /opt/VirtualBox/vboxwebsrv does not exist."
29 return $SMF_EXIT_ERR_CONFIG
30 fi
31
32 if [ ! -f /opt/VirtualBox/vboxwebsrv ]; then
33 echo "ERROR: /opt/VirtualBox/vboxwebsrv does not exist."
34 return $SMF_EXIT_ERR_CONFIG
35 fi
36
37 # Get svc configuration
38 VW_USER=`/usr/bin/svcprop -p config/user $SMF_FMRI 2>/dev/null`
39 [ $? != 0 ] && VW_USER=
40 VW_HOST=`/usr/bin/svcprop -p config/host $SMF_FMRI 2>/dev/null`
41 [ $? != 0 ] && VW_HOST=
42 VW_PORT=`/usr/bin/svcprop -p config/port $SMF_FMRI 2>/dev/null`
43 [ $? != 0 ] && VW_PORT=
44 VW_TIMEOUT=`/usr/bin/svcprop -p config/timeout $SMF_FMRI 2>/dev/null`
45 [ $? != 0 ] && VW_TIMEOUT=
46 VW_CHECK_INTERVAL=`/usr/bin/svcprop -p config/checkinterval $SMF_FMRI 2>/dev/null`
47 [ $? != 0 ] && VW_CHECK_INTERVAL=
48 VW_KEEPALIVE=`/usr/bin/svcprop -p config/keepalive $SMF_FMRI 2>/dev/null`
49 [ $? != 0 ] && VW_KEEPALIVE=
50
51 # Provide sensible defaults
52 [ -z "$VW_USER" ] && VW_USER=root
53 [ -z "$VW_HOST" ] && VW_HOST=localhost
54 [ -z "$VW_PORT" -o "$VW_PORT" -eq 0 ] && VW_PORT=18083
55 [ -z "$VW_TIMEOUT" ] && VW_TIMEOUT=20
56 [ -z "$VW_CHECK_INTERVAL" ] && VW_CHECK_INTERVAL=5
57 [ -z "$VW_KEEPALIVE" ] && VW_KEEPALIVE=1000
58 exec su - "$VW_USER" -c "/opt/VirtualBox/vboxwebsrv --host \"$VW_HOST\" --port \"$VW_PORT\" --timeout \"$VW_TIMEOUT\" --check-interval \"$VW_CHECK_INTERVAL\" --keepalive \"$VW_KEEPALIVE\""
59
60 VW_EXIT=$?
61 if [ $VW_EXIT != 0 ]; then
62 echo "vboxwebsrv failed with $VW_EXIT."
63 VW_EXIT=1
64 fi
65 ;;
66 stop)
67 # Kill service contract
68 smf_kill_contract $2 TERM 1
69 ;;
70 *)
71 VW_EXIT=$SMF_EXIT_ERR_CONFIG
72 ;;
73esac
74
75exit $VW_EXIT
Note: See TracBrowser for help on using the repository browser.

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