Bug 14852 - child winbindd logs to log.winbindd instead of log.wb-<DOMAIN>
Summary: child winbindd logs to log.winbindd instead of log.wb-<DOMAIN>
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
Depends on:
Reported: 2021-10-01 15:52 UTC by Pavel Filipenský
Modified: 2021-10-27 13:26 UTC (History)
3 users (show)

See Also:

patch for v4-15 (3.84 KB, patch)
2021-10-08 19:48 UTC, Pavel Filipenský
no flags Details
new patch for 4.15 (9.14 KB, patch)
2021-10-20 13:08 UTC, Pavel Filipenský
asn: review+
pfilipen: review? (jra)
slow: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Filipenský 2021-10-01 15:52:14 UTC
I have spotted in the latest samba build that winbindd children log to log.winbindd.

This was introduced via commit
cf4a868 2021-09-17 10:22 +0200 Volker Lendecke o debug: Remove "override_logfile"

winbindd_reinit_after_fork() no longer takes the if branch:

-       if (!override_logfile && logfilename) {
+       if (is_default_dyn_LOGFILEBASE() && logfilename) {
Comment 1 Pavel Filipenský 2021-10-08 11:28:41 UTC
Patch will follow.
Comment 2 Jeremy Allison 2021-10-08 17:45:55 UTC
Thanks for taking care of this Pavel, I'll review once your patch is ready.
Comment 3 Pavel Filipenský 2021-10-08 19:48:55 UTC
Created attachment 16843 [details]
patch for v4-15
Comment 4 Pavel Filipenský 2021-10-08 19:50:18 UTC
Handling of logfile name for main and child winbindd must ensure:

1) Log directory is selected in this order:
  * -l option of winbindd
  * "log file" parameter in smb.conf
  * compile time value '/usr/local/samba/var'

2) Log filename pattern
  * parent process uses log.winbindd
  * child uses log.wb-<name>

3) Log reopen works for both parent and child (i.e. log filename is not changed)
  * kill -HUP <pid>
  * smbcontrol <pid> reload-config

This fix removes 3 calls of is_default_dyn_LOGFILEBASE() to make sure that:
  - 1st removal: child uses log.wb-<name> after the fork
  - 2nd removal: child after HUP signal, does not switch to log.winbindd
  - 3rd removal: child after smbcontrol reload-config, does not switch to
Comment 5 Samba QA Contact 2021-10-12 09:31:04 UTC
This bug was referenced in samba master:

Comment 6 Jeremy Allison 2021-10-14 23:50:15 UTC
Comment on attachment 16843 [details]
patch for v4-15

Pavel, this doesn't apply to v4-15-test. Can you check this applies to a current 4.15 tree ?
Comment 7 Pavel Filipenský 2021-10-20 13:08:17 UTC
Created attachment 16860 [details]
new patch for 4.15

This patch contains also one additional commit cf4a868, it is needed
Comment 8 Ralph Böhme 2021-10-20 14:25:43 UTC
Reassigning to Jule for inclusion in 4.15.
Comment 9 Samba QA Contact 2021-10-22 08:40:04 UTC
This bug was referenced in samba v4-15-test:

Comment 10 Jule Anger 2021-10-22 09:08:43 UTC
Closing out bug report.

Comment 11 Samba QA Contact 2021-10-27 13:26:03 UTC
This bug was referenced in samba v4-15-stable (Release samba-4.15.1):