Samba: how to disable nmbd?

Hi, I wanted to disable nmbd daemon to save some ram, because I don't need it, but it looks like the option disable netbios = yes is ignored. Here's my /etc/samba/smb.conf.template:

[global]
        netbios name = |NAME|
        display charset = |CHARSET|
        interfaces = |INTERFACES|
        server string = |DESCRIPTION|
        unix charset = |CHARSET|
        workgroup = |WORKGROUP|
        bind interfaces only = yes
        deadtime = 30
        enable core files = no
        invalid users = root
        local master = no
        map to guest = Bad User
        max protocol = SMB2
        min receivefile size = 16384
        null passwords = yes
        passdb backend = smbpasswd
        security = user
        smb passwd file = /etc/samba/smbpasswd
        use sendfile = yes

        disable netbios = yes

But It has no effect, nmbd is started anyway. I guess I can kill it from rc.local, but I don't like starting something to be killed later approach, I believe there's a proper way. Thank you.

Config files are not edited there. Configs are located at /etc/config

That's likely a meta file created by the UCI on boot/commit.

Thanks, but you're wrong. This is actually a place where you can set options which are not supported by uci. Changes from the template are merged with those set in /etc/config and placed in /etc/samba/smb.conf, you can check it out.

But it seems that I came up with a bit nicer solution than kiling nmbd, I just commented it out and it does not start anymore:
/etc/init.d/samba:

start_service() {
        init_config

        procd_open_instance
        procd_set_param command /usr/sbin/smbd -F
        procd_set_param respawn
        procd_set_param file /var/etc/smb.conf
        procd_close_instance

#       procd_open_instance
#       procd_set_param command /usr/sbin/nmbd -F
#       procd_set_param respawn
#       procd_set_param file /var/etc/smb.conf
#       procd_close_instance
}

But I don't like this either. Why openwrt's samba ignores the option?

1 Like

I stand corrected...the Wiki does mention /etc/samba/smb.conf.template

I've never seen that, and I never configured my Samba from that file...guess I never had to do any advanced configs. Thanks, I'm actually setting up another Samba server soon!

I'm glad you got it working...regarding the comments...there's a thread about new samba development, perhaps someone there can help.

https://forum.openwrt.org/search?q=Need%20testers%20for%20Samba%204.8%20package%20feed%20

Process is started anyway even if it's disabled... Think samba will ignore NetBIOS traffic if it's disabled

1 Like

As noted the config option disable netbios = yes only instructs nmbd to ignore netbios requests, while the daemon will still be started by the init script.
If you check the init script from my samba4 feed, you will notice that it explicitly checks for this config setting and then skips starting the nmbd.
The current feed version does not even build the nmbd by default anymore, since its useless for normal Win10 workgroup operation and i replaced it with a WSD daemon. This ensures the shares show up again under windows 10 explorer.

PS: see feed: https://github.com/Andy2244/openwrt-extra

1 Like