[Bug 254006] net/samba(all versions): rc.d/samba_server stop/restart patch for restart crash

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Mar 4 08:50:13 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254006

            Bug ID: 254006
           Summary: net/samba(all versions): rc.d/samba_server
                    stop/restart patch for restart crash
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs at FreeBSD.org
          Reporter: pen at lysator.liu.se

Created attachment 222968
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=222968&action=edit
Patch to fix samba_server rc.d script to wait for all processes to die

The rc.d/samba_server script when stopping and/or restarting samba doesn't wait
for _all_ smbd processes to terminate before continuing - it only wait´s for
the master process. This can cause Samba (smbd) processes to core dump if a new
master smbd process gets started before all the old processes has had time to
terminate.

With a non-busy server this rarely get noticed since it happens during samba
shutdown and only on busy servers - and for you to get the core dumps you need
to have enabled sugid-coredumps...

/etc/sysctl.conf:
  kern.corefile = /var/cores/%N.%P.core
  kern.sugid_coredump = 1

This is related to this Samba issue:
  https://bugzilla.samba.org/show_bug.cgi?id=14636

The solution is to modify the rc.d/samba_server script so it waits for all smbd
processes to terminate, not just the master process, before continuing.

Please find enclosed a patch that implements this wait-loop.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list