File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -678,6 +678,14 @@ let listen_unix_socket () =
678678 let domain_sock = Xapi_http. bind (Unix. ADDR_UNIX (Xapi_globs. unix_domain_socket)) in
679679 ignore(Http_svr. start Xapi_http. server domain_sock)
680680
681+ let set_stunnel_timeout () =
682+ try
683+ let timeout = int_of_string (Xapi_inventory. lookup Xapi_inventory. _stunnel_idle_timeout) in
684+ debug " Setting stunnel timeout to %d" timeout;
685+ Stunnel. timeoutidle := Some timeout
686+ with _ ->
687+ debug " Using default stunnel timeout (usually 43200)"
688+
681689let server_init() =
682690 let print_server_starting_message() = debug " on_system_boot=%b pool_role=%s" ! Xapi_globs. on_system_boot (Pool_role. string_of (Pool_role. get_role () )) in
683691
@@ -781,6 +789,7 @@ let server_init() =
781789 Startup. run ~__context [
782790 " XAPI SERVER STARTING" , [], print_server_starting_message;
783791 " Parsing inventory file" , [], Xapi_inventory. read_inventory;
792+ " Setting stunnel timeout" , [], set_stunnel_timeout;
784793 " Initialising local database" , [], init_local_database;
785794 " Loading DHCP leases" , [], Xapi_udhcpd. init;
786795 " Reading pool secret" , [], Helpers. get_pool_secret;
Original file line number Diff line number Diff line change @@ -52,7 +52,12 @@ mgmt_ip() {
5252writeconffile () {
5353 # Initial boilerplate which is valid whether the management
5454 # interface is enabled or disabled.
55- cat > $SSLCONFFILE << EOF
55+ . /etc/xensource-inventory
56+
57+ if [ -n " ${STUNNEL_IDLE_TIMEOUT} " ]; then
58+ TIMEOUTSTR=" TIMEOUTidle = ${STUNNEL_IDLE_TIMEOUT} "
59+ fi
60+ cat > $SSLCONFFILE << EOF
5661; Autogenerated by init.d/xapissl
5762pid = ${SSLPIDFILE}
5863socket = r:TCP_NODELAY=1
@@ -61,6 +66,7 @@ socket = l:TCP_NODELAY=1
6166socket = r:SO_KEEPALIVE=1
6267socket = a:SO_KEEPALIVE=1
6368compression = zlib
69+ ${TIMEOUTSTR}
6470
6571[xapi]
6672accept = ${ACCEPT}
You can’t perform that action at this time.
0 commit comments