<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 3, 2015 at 9:44 PM, Paul D. DeRocco <span dir="ltr"><<a href="mailto:pderocco@ix.netcom.com" target="_blank">pderocco@ix.netcom.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I have a Yocto embedded system running a simple Samba 4 server, using<br>
systemd. I'm relying on the system hostname being the default netbios<br>
name, and I need to be able to change the hostname, and therefore the<br>
netbios name, from within my main application. I write the new hostname to<br>
/etc/hostname, and also call sethostname(), but in order for the change to<br>
take effect, the nmbd daemon (that is, nmb.service) needs to be restarted.<br>
<br>
Since systemd is managing this service, it seems I should be accomplishing<br>
this by telling systemd to restart the service. Is there a documented way<br>
to do this from within a program? There must be some way, since systemctl<br>
does it.<br></blockquote><div><br></div><div>Pretty sure it's documented:</div><div><br></div><div><a href="http://www.freedesktop.org/wiki/Software/systemd/dbus/">http://www.freedesktop.org/wiki/Software/systemd/dbus/</a></div><br class=""><a href="http://www.freedesktop.org/wiki/Software/systemd/hostnamed/">http://www.freedesktop.org/wiki/Software/systemd/hostnamed/</a></div><div class="gmail_quote"><div><br></div><div>and so on.</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>