Having samba in both lxd-host and container causes smbd to fail in host. You can test if smbd is running by:
root@host:~# netstat -apn | grep 445
tcp 0 0 127.0.0.1:445 0.0.0.0:* LISTEN 13390/smbd
tcp 0 0 a.b.c.d:445 0.0.0.0:* LISTEN 13390/smbd
tcp 0 0 10.147.20.1:445 0.0.0.0:* LISTEN 13390/smbd
tcp 0 0 a.b.c.d:445 a.b.c.55:3029 TIME_WAIT -
tcp 0 0 a.b.c.d:445 a.b.c.44:35502 FIN_WAIT2 -
tcp 0 0 a.b.c.d:445 a.b.c.55:3031 ESTABLISHED 13395/smbd
tcp6 0 0 ::1:445 :::* LISTEN 13390/smbd
unix 2 [ ACC ] STREAM LISTENING 22445 1/init /run/snapd.socket
Soln: Changed this line in the file /etc/init.d/smbd
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D ; then
to
if ! start-stop-daemon --start --quiet --oknodo --pidfile /var/run/samba/smbd.pid --exec /usr/sbin/smbd -- -D ; then
This way it starts smbd if it’s pid file does not exist.
Is there any place to raise this bug? I am posting this here as anyone doing the same can be warned.