mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 20:23:01 +02:00
confd: call lldpcl and avahi-set-host-name after system bootstrap
Services have not even started up yet, so system() calls will only unnecessarily delay the boot. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
4d76da309d
commit
69fa434b44
@@ -971,9 +971,12 @@ static int change_hostname(sr_session_ctx_t *session, uint32_t sub_id, const cha
|
||||
free(hosts);
|
||||
free(current);
|
||||
|
||||
/* Inform any running lldpd and avahi of the change ... */
|
||||
systemf("lldpcli configure system hostname %s", nm);
|
||||
systemf("avahi-set-host-name %s", nm);
|
||||
/* skip in bootstrap, daemons not started yet*/
|
||||
if (!systemf("runlevel >/dev/null 2>&1")) {
|
||||
/* Inform any running lldpd and avahi of the change ... */
|
||||
systemf("lldpcli configure system hostname %s", nm);
|
||||
systemf("avahi-set-host-name %s", nm);
|
||||
}
|
||||
err:
|
||||
if (nm)
|
||||
free(nm);
|
||||
|
||||
Reference in New Issue
Block a user