Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,10 @@ def _restart_services(config_db):

execute_systemctl(services_to_restart, SYSTEMCTL_ACTION_RESTART)

# Reload Monit configuration to pick up new hostname in case it changed
click.echo("Reloading Monit configuration ...")
clicommon.run_command("sudo monit reload")


def interface_is_in_vlan(vlan_member_table, interface_name):
""" Check if an interface is in a vlan """
Expand Down Expand Up @@ -1233,6 +1237,11 @@ def hostname(new_hostname):
except SystemExit as e:
click.echo("Restarting hostname-config service failed with error {}".format(e))
raise

# Reload Monit configuration to pick up new hostname in case it changed
click.echo("Reloading Monit configuration ...")
clicommon.run_command("sudo monit reload")

click.echo("Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.")

#
Expand Down
1 change: 1 addition & 0 deletions tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
Executing restart of service hostcfgd...
Executing restart of service nat...
Executing restart of service telemetry...
Reloading Monit configuration ...
Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.
"""

Expand Down