nmbd frequently failed after reboot

The nmbd is always failing during reboot. After it failed, just issue “service nmbd restart” to get nmbd running. Is there a way to use simplest settings to ensure nmbd can startup without fail.

May be it has to do with these errors:

nmbd[1173]: invalid permissions on directory '/var/log/samba/cores': has 0775 should be 0700
nmbd[1173]: Failed to create /var/log/samba/cores for user 0 with mode 0700

Even I change the permission to 0700, but after reboot it will fall back to 0775.

I think I have solved the issue. Instead of putting “service nmbd restart” at dietpi-autostart/custom.sh I put it at /etc/rc.local and run it after sleep 5 seconds. So each time after reboot, nmbd is running and not in a failed state.