Skip to content

Commit f28d543

Browse files
committed
CA-180495: Run update-issue service on management_interface re-configure
File /etc/issue needs to be updated with latest management ip on performing management_interface re-configure. This can be achived by running update-issue service and restarting the terminals. Signed-off-by: Sharad Yadav <[email protected]>
1 parent 701cc6d commit f28d543

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

ocaml/xapi/xapi_globs.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,10 @@ let gpg_homedir = ref "/opt/xensource/gpg"
816816

817817
let static_vdis_dir = ref "/etc/xensource/static-vdis"
818818

819+
let update_issue_script = ref "update-issue"
820+
821+
let kill_process_script = ref "killall"
822+
819823
let disable_logging_for= ref []
820824

821825
let igd_passthru_vendor_whitelist = ref []
@@ -1044,6 +1048,8 @@ module Resources = struct
10441048
"xapi-message-script", xapi_message_script, "Executed when messages are generated if email feature is disabled";
10451049
"non-managed-pifs", non_managed_pifs, "Executed during PIF.scan to find out which NICs should not be managed by xapi";
10461050
"xenvmd", xenvmd_path, "Xenvmd executable for thin-provisioned block storage";
1051+
"update-issue", update_issue_script, "Running update-service when configuring the management interface";
1052+
"killall", kill_process_script, "Executed to kill process";
10471053
]
10481054
let essential_files = [
10491055
"pool_config_file", pool_config_file, "Pool configuration file";

ocaml/xapi/xapi_mgmt_iface.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ let on_dom0_networking_change ~__context =
195195
end
196196
end;
197197
Helpers.update_domain_zero_name ~__context localhost new_hostname;
198+
(* Running update-issue service on best effort basis *)
199+
try
200+
ignore (Forkhelpers.execute_command_get_output !Xapi_globs.update_issue_script []);
201+
ignore (Forkhelpers.execute_command_get_output !Xapi_globs.kill_process_script ["-q"; "-HUP"; "mingetty"; "agetty"])
202+
with _ -> ();
198203
debug "Signalling anyone waiting for the management IP address to change";
199204
Mutex.execute management_ip_mutex
200205
(fun () -> Condition.broadcast management_ip_cond)

scripts/xapi.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ sm-plugins=ext nfs iscsi lvmoiscsi dummy file hba rawhba udev iso lvm lvmohba lv
168168
# Path to the xen-cmdline binary
169169
# xen-cmdline = @LIBEXECDIR@/xen-cmdline
170170

171+
# Path to the update-issue script
172+
# update-issue-script = /sbin/update-issue
173+
174+
# Path to the kill-process script
175+
# kill-process-script = /usr/bin/killall
176+
171177
# Root directory for xapi hooks
172178
# xapi-hooks-root = @HOOKSDIR@
173179

0 commit comments

Comments
 (0)