Skip to content

Commit d492401

Browse files
author
Lin Liu
committed
CP-311169: samba: include /etc/samba/smb.extra.conf
Samba has lots of feature and configurations, https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html Some of them are passthrough from xapi configuration to samba However, this requires xapi rebuild and make xapi uncessary complicated. On the other side, sometimes we do need customer to tune some args, especially for debug purpose, and we do want such configuration can persist cross xapi restart. A new configuration /etc/samba/smb.extra.conf is introduced. The xapi generated/overrided /etc/samba/smb.conf include it. Customer can update this file with guide of support team for debug purpose Signed-off-by: Lin Liu <lin.liu01@citrix.com>
1 parent beed772 commit d492401

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ocaml/xapi/extauth_plugin_ADwinbind.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ let query_domain_workgroup ~domain =
780780

781781
let config_winbind_daemon ~workgroup ~netbios_name ~domain =
782782
let smb_config = "/etc/samba/smb.conf" in
783+
let extra_conf = "/etc/samba/smb.extra.conf" in
783784
let string_of_bool = function true -> "yes" | false -> "no" in
784785

785786
let scan_trusted_domains =
@@ -788,7 +789,7 @@ let config_winbind_daemon ~workgroup ~netbios_name ~domain =
788789
( match (workgroup, netbios_name, domain) with
789790
| Some wkgroup, Some netbios, Some dom ->
790791
[
791-
"# autogenerated by xapi"
792+
Printf.sprintf "# This file is managed by xapi, change %s instead" extra_conf
792793
; "[global]"
793794
; "client use kerberos = required"
794795
; "sync machine password to keytab = \
@@ -815,6 +816,7 @@ let config_winbind_daemon ~workgroup ~netbios_name ~domain =
815816
; "idmap config * : backend = autorid"
816817
; Printf.sprintf "idmap config * : range = %d-%d" 2_000_000 99_999_999
817818
; Printf.sprintf "log level = %s" (debug_level ())
819+
; Printf.sprintf "include = %s" extra_conf
818820
; "" (* Empty line at the end *)
819821
]
820822
| _ ->

0 commit comments

Comments
 (0)