File tree 2 files changed +22
-2
lines changed 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ let create_localhost ~__context info =
64
64
~ssh_enabled_timeout: Constants. default_ssh_enabled_timeout
65
65
~ssh_expiry: Date. epoch
66
66
~console_idle_timeout: Constants. default_console_idle_timeout
67
- ~ssh_auto_mode: Constants. default_ssh_auto_mode
67
+ ~ssh_auto_mode: ! Xapi_globs. ssh_auto_mode_default
68
68
in
69
69
()
70
70
@@ -384,7 +384,19 @@ let update_env __context sync_keys =
384
384
switched_sync Xapi_globs. sync_ssh_status (fun () ->
385
385
let ssh_service = ! Xapi_globs. ssh_service in
386
386
let status = Fe_systemctl. is_active ~service: ssh_service in
387
- Db.Host. set_ssh_enabled ~__context ~self: localhost ~value: status
387
+ Db.Host. set_ssh_enabled ~__context ~self: localhost ~value: status ;
388
+ let auto_mode_in_db =
389
+ Db.Host. get_ssh_auto_mode ~__context ~self: localhost
390
+ in
391
+ let ssh_monitor_enabled =
392
+ Fe_systemctl. is_active ~service: ! Xapi_globs. ssh_monitor_service
393
+ in
394
+ (* For xs9 when fresh install, the ssh_monitor service is not enabled by default.
395
+ If the auto_mode is enabled, we need to enable the ssh_monitor service.
396
+ and user may have disabled monitor service by mistake as well, so we need to check the status. *)
397
+ if auto_mode_in_db <> ssh_monitor_enabled then
398
+ Xapi_host. set_ssh_auto_mode ~__context ~self: localhost
399
+ ~value: auto_mode_in_db
388
400
) ;
389
401
390
402
remove_pending_guidances ~__context
Original file line number Diff line number Diff line change @@ -1299,6 +1299,8 @@ let ssh_service = ref "sshd"
1299
1299
1300
1300
let ssh_monitor_service = ref " xapi-ssh-monitor"
1301
1301
1302
+ let ssh_auto_mode_default = ref true
1303
+
1302
1304
(* Fingerprint of default patch key *)
1303
1305
let citrix_patch_key =
1304
1306
" NERDNTUzMDMwRUMwNDFFNDI4N0M4OEVCRUFEMzlGOTJEOEE5REUyNg=="
@@ -1743,6 +1745,12 @@ let other_options =
1743
1745
, (fun () -> string_of_bool ! validate_reusable_pool_session)
1744
1746
, " Enable validation of reusable pool sessions before use"
1745
1747
)
1748
+ ; ( " ssh-auto-mode"
1749
+ , Arg. Bool (fun b -> ssh_auto_mode_default := b)
1750
+ , (fun () -> string_of_bool ! ssh_auto_mode_default)
1751
+ , " Defaults to true; overridden to false via \
1752
+ /etc/xapi.conf.d/ssh-auto-mode.conf(e.g., in XenServer 8)"
1753
+ )
1746
1754
]
1747
1755
1748
1756
(* The options can be set with the variable xapiflags in /etc/sysconfig/xapi.
You can’t perform that action at this time.
0 commit comments