[systemd-devel] Restarting nmb.service from within a program

Mantas Mikul─Śnas grawity at gmail.com
Tue Nov 3 12:39:29 PST 2015

On Tue, Nov 3, 2015 at 9:44 PM, Paul D. DeRocco <pderocco at ix.netcom.com>

> I have a Yocto embedded system running a simple Samba 4 server, using
> systemd. I'm relying on the system hostname being the default netbios
> name, and I need to be able to change the hostname, and therefore the
> netbios name, from within my main application. I write the new hostname to
> /etc/hostname, and also call sethostname(), but in order for the change to
> take effect, the nmbd daemon (that is, nmb.service) needs to be restarted.
> Since systemd is managing this service, it seems I should be accomplishing
> this by telling systemd to restart the service. Is there a documented way
> to do this from within a program? There must be some way, since systemctl
> does it.

Pretty sure it's documented:



and so on.

Mantas Mikul─Śnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151103/49b35034/attachment.html>

More information about the systemd-devel mailing list