Samba Including Default Config File

  • Hi,

    I have an issue with samba reading both my configurations (~/.config/samba.conf) and the default configurations (/etc/samba/smb.conf). I would like to only have my custom folders but instead see all the folders from both config files.

    Running LibreELEC 9.2 x86

    Please help.

  • Apologies for not being clear. ~/.config/ and /storage/.config/ is the same directory. How do I get samba to only use the file inside the .config/ directory and not include the file under /etc/samba/ ?

  • If /storage/.config/samba.conf exists it is used exclusively for the samba server configuration. The sample file in /storage/.config is recreated on each boot from the embedded file so it always remains current for the version of samba we're shipping. If you base you config on the sample file, you'll get the default config plus your addiions (or removals).

  • The issue might not be with samba. I removed the default configured folders from the config file. It is setup to only map the storage folder. This way it makes it easier for me to do a sync. I then deleted the default folders from storage. When I restart samba the storage folder only has my folders in and not the default 'tv shows', etc. But if I restart LibreElec the folders come back. The reason I suspect it is samba that creates the folders is because that is how it is setup in the samba default config file.

  • The only way to stop that behaviour is modifying packages/mediacenter/kodi/tmpfiles.d/kodi-userdirs.conf in the build-system and then building a custom image with the modification. In our standardd image they will always be recreated on boot (by systemd not samba).

    You can probably hack a delete via /storage/.config/autostart.sh but since this runs at the start of userspace boot you'll need to background the task for aa few seconds, e.g.

    Code
    (
    sleep 10
    rm -rf /storage/tvshows
    rm -rf /storage/videos
    rm -rf /storage/music
    )&