mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 20:43:02 +02:00
confd: ensure change_hostname() returns a sysrepo error code
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
d5298d10e8
commit
bfce877525
@@ -1044,12 +1044,15 @@ static int change_hostname(sr_session_ctx_t *session, uint32_t sub_id, const cha
|
||||
free(hosts);
|
||||
free(current);
|
||||
|
||||
/* 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);
|
||||
if (err) {
|
||||
ERROR("failed setting hostname");
|
||||
err = SR_ERR_SYS;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* 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