Fix #57: unneccesary lldpd restarts on configuration change

Instead of restarting lldpd we can call lldpcli to inform lldpd of the change.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-06-30 14:13:09 +02:00
committed by Tobias Waldekranz
parent 6410a96d6d
commit e4a1261ad8
2 changed files with 5 additions and 2 deletions
@@ -1 +1 @@
service [2345789] <!> env:-/etc/default/lldpd lldpd -d $LLDPD_ARGS -- LLDP daemon (IEEE 802.1ab)
service [2345789] env:-/etc/default/lldpd lldpd -d $LLDPD_ARGS -- LLDP daemon (IEEE 802.1ab)
+4 -1
View File
@@ -264,7 +264,7 @@ done:
static int sys_reload_services(void)
{
return systemf("initctl -nbq touch sysklogd lldpd");
return systemf("initctl -nbq touch sysklogd");
}
static int aug_set_dynpath(augeas *aug, const char *val, const char *fmt, ...)
@@ -958,6 +958,9 @@ static int change_hostname(sr_session_ctx_t *session, uint32_t sub_id, const cha
if (nhosts)
free(hosts);
free(current);
/* Inform any running lldpd and avahi of the change ... */
systemf("lldpcli configure system hostname %s", nm);
err:
if (nm)
free(nm);