[Samba] systemctl stop winbind (with CTDB) hanging

Rowland Penny rpenny at samba.org
Tue Oct 10 09:26:55 UTC 2023


On Tue, 10 Oct 2023 12:30:38 +1100
Martin Schwenke via samba <samba at lists.samba.org> wrote:

> I'm running a clustered Samba stack in a container, with systemd
> inside the container.  systemctl reliably gets stuck when shutting
> down winbind, which means my CTDB startup (which attempts to force
> winbind shutdown before startup) times out.
> 
> If I try from the command-line, I see this:
> 
> # systemctl start winbind
> # time systemctl stop winbind </dev/null
> 
> real  1m30.168s
> user  0m0.004s
> sys   0m0.000s
> 
> So, this is hitting DefaultTimeoutStopSec.  The absolutely remarkable
> thing is that systemd *knows* that winbind has already exited:
> 
> # systemctl status winbind
> ● winbind.service - Samba Winbind Daemon
>    Loaded: loaded (/usr/lib/systemd/system/winbind.service; disabled;
> vendor preset: disa> Active: deactivating (final-sigterm) since Tue
> 2023-10-10 01:03:10 UTC; 53s ago Docs: man:winbindd(8)
>            man:samba(7)
>            man:smb.conf(5)
>   Process: 10770 ExecStart=/usr/sbin/winbindd --foreground
> --no-process-group $WINBINDOPT> Main PID: 10770 (code=exited,
> status=0/SUCCESS) Status: "winbindd: ready to serve connections..."
>     Tasks: 0 (limit: 1225141)
>    Memory: 248.0K
>    CGroup:
> /docker/2021fe3169835c9fc632f84035d600e3a635e5da79628a487135500b65efd879/syste>
> 
> How can it be that systemd knows that the process is gone but is still
> "deactivating"?  Is there something we need to do to our
> winbind.system file to avoid this nonsense?  I know I can probably
> change TimeoutStopSec to < 90s, but that seems like something I
> shouldn't have to do.  Is there something we need to do in winbindd?

I am not an expert on systemd (far from it), but reading the systemd
service file on my Debian 11 system, it seems that under [Service] it
is 'Type=notify', if yours is the same, perhaps changing that to
'forking' might help.

Rowland





More information about the samba mailing list