I need to perform certain maintenance work on a Nethserver 8 share and disable it beforehand – but without shutting down the other services and, above all, without shutting down the samba-ad as a whole.
Is there a planned solution for this?
For my maintenance, I need to temporarily unmount a specific file system – which I mounted to /home/samba1/.local/share/containers/storage/volumes/shares/_data/MYSHARE.
According to “lsof,” the mount isn’t blocked, but the samba1 container at least logically continues to use the path.
I know how to perform my maintenance, but I’m not entirely sure how to temporarily disable individual shares – apparently, only “removal” is provided. “Removing” is not only impractical but perhaps also risky, because the container might then remove the share path, which I’ll need to remount later.
Any advice is welcome.
As far as I can tell, it would be more practical for my project to have a completely separate Samba-AD container here and the Samba shares in another one. I don’t know if that’s possible, but it might not be the worst goal.
I think it’s the simplest way to remove it from the configuration and readd it again after the maintenance.
This could be done using net conf in the samba-dc container.
Another approach could be to set permissions so clients can’t access the share anymore but I think it’s cleaner when the share isn’t available at all.
Enter the samba-dc container:
runagent -m samba1 podman exec -ti samba-dc bash
Remove share testfolder from config:
net conf delshare testfolder
Readd testfolder to config: (The description could be empty like “” but is required to list the shares in the cluster-admin without error)
net conf addshare testfolder /srv/shares/testfolder writeable=y guest_ok=N "Description"
Título: Desativando a Criação Automática de Diretórios Home no Samba (NethServer 8 – Container rootless)
Cliente/Projeto: Fernacom Informática Corporativa
Objetivo
Registrar o procedimento definitivo para impedir que o Samba, executando em container rootless (usuário samba4) no NethServer 8, crie automaticamente os diretórios home (/srv/homes/<usuário> ) para novos usuários.
Cenário Detectado
Distribuição base: Rocky Linux 9.5 (Blue Onyx) – host do NethServer 8.
Serviço de arquivos: Samba rodando em containerrootless (podman ) como usuário samba4 .
Arquivo de configuração gerado:/home/samba4/.local/share/containers/storage/volumes/config/_data/smb.conf .
O cabeçalho do arquivo exibe: # Generated by expand-config. Manual changes to this file are lost!
➜ A configuração é regerada por um script /usr/local/sbin/expand-config dentro do container.
A seção [homes] é reinserida a cada “expand”, recriando o compartilhamento homes.
Thanks for your great howtos. As this forum is in English language, please, if possible, post your howtos in the Howto category and in English language.