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 @@ -680,6 +680,14 @@ let listen_unix_socket () =
680680 let domain_sock = Xapi_http. bind (Unix. ADDR_UNIX (Xapi_globs. unix_domain_socket)) in
681681 ignore(Http_svr. start Xapi_http. server domain_sock)
682682
683+ let set_stunnel_timeout () =
684+ try
685+ let timeout = int_of_string (Xapi_inventory. lookup Xapi_inventory. _stunnel_idle_timeout) in
686+ debug " Setting stunnel timeout to %d" timeout;
687+ Stunnel. timeoutidle := Some timeout
688+ with _ ->
689+ debug " Using default stunnel timeout (usually 43200)"
690+
683691let server_init() =
684692 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
685693
@@ -783,6 +791,7 @@ let server_init() =
783791 Startup. run ~__context [
784792 " XAPI SERVER STARTING" , [], print_server_starting_message;
785793 " Parsing inventory file" , [], Xapi_inventory. read_inventory;
794+ " Setting stunnel timeout" , [], set_stunnel_timeout;
786795 " Initialising local database" , [], init_local_database;
787796 " Loading DHCP leases" , [], Xapi_udhcpd. init;
788797 " 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