[systemd-devel] Questions about nmb.service
Paul D. DeRocco
pderocco at ix.netcom.com
Sun Aug 6 02:17:34 UTC 2017
Yocto-based non-GUI Raspberry Pi 3 system using systemd and Samba 4. I think
these are more systemd questions than Samba questions, though.
My /etc/hostname is symlinked to a file on a different volume, so that I can
(eventually) use a readonly rootfs, yet still change the hostname. However,
that volume doesn't get mounted in time for the kernel to read it, so I end
up with the hostname "localhost". Since I want to use the hostname as the
default netbios name, I supplied my own version of nmb.service, which adds
the line "RequiresMountsFor=/run/media/mmcblk0p1" to the [Unit] section, and
the line "ExecStartPre=/bin/hostname -F /etc/hostname" to the [Service]
section. This ensures that nmbd doesn't get started until the hostname file
is visible, and forces the hostname to be set first.
When I boot up, I get an error starting nmb.service. systemctl status nmb
shows:
Aug 06 01:59:18 localhost systemd[1]: Starting Samba NMB Daemon...
Aug 06 01:59:18 CHROMA3 nmbd[440]: [2017/08/06 01:59:18.576291, 0]
../lib/util/become_daemon.c:135(daemon_status)
Aug 06 01:59:18 CHROMA3 nmbd[440]: STATUS=daemon 'nmbd' : No local IPv4
non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS
name resolution is not supported for Internet Protocol Version 6 (IPv6).
(CHROMA3 is the real hostname I've set.) After five seconds, it tries again,
and it works:
Aug 06 01:59:23 CHROMA3 nmbd[440]: [2017/08/06 01:59:23.582234, 0]
../lib/util/become_daemon.c:124(daemon_ready)
Aug 06 01:59:23 CHROMA3 systemd[1]: Started Samba NMB Daemon.
Aug 06 01:59:23 CHROMA3 nmbd[440]: STATUS=daemon 'nmbd' finished starting
up and ready to serve connections
I can see my shared files across the network. However, if I manually restart
the service, I get the following warning in the second line:
Aug 06 02:06:45 CHROMA3 systemd[1]: Starting Samba NMB Daemon...
Aug 06 02:06:45 CHROMA3 systemd[1]: nmb.service: Supervising process 503
which is not our child. We'll most likely not notice when it exits.
Aug 06 02:06:45 CHROMA3 nmbd[503]: [2017/08/06 02:06:45.748754, 0]
../lib/util/become_daemon.c:124(daemon_ready)
Aug 06 02:06:45 CHROMA3 nmbd[503]: STATUS=daemon 'nmbd' finished starting
up and ready to serve connections
Aug 06 02:06:45 CHROMA3 systemd[1]: Started Samba NMB Daemon.
If I restart it again, something does indeed "notice", and kill process 503
and give me another one, so it's not really a problem. But there are two
things that look like I might be doing something wrong:
1) Why does it initially find "No local IPV4 non-loopback interfaces
available", and is there something I can do to change the startup order
until the ethernet device is ready, or is this just normal?
2) Why does systemd think it doesn't own the nmbd process, and should I do
something about that, or is that normal?
--
Ciao, Paul D. DeRocco
Paul mailto:pderocco at ix.netcom.com
More information about the systemd-devel
mailing list