Your message dated Fri, 24 Aug 2018 06:03:25 +0200 with message-id <CAFX5sbxRDFcGzA7aUmg0nhWJEHWFN37y-pOgCv=c7ozmrwf...@mail.gmail.com> and subject line Re: [Pkg-samba-maint] Bug#905954: samba: Logrotate for /var/log/samba/log.smbd fails if samba is in AD mode has caused the Debian Bug report #905954, regarding samba: Logrotate for /var/log/samba/log.smbd fails if samba is in AD mode to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 905954: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905954 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: samba Version: 2:4.5.12+dfsg-2+deb9u2 Severity: normal Dear Maintainer, I'm using samba 4 in AD mode. Therefore, smbd and nmbd services are disabled, and the samba-ad-dc service is enabled. The logrotate conf included with samba (/etc/logrotate.d/samba) only checks if a smbd pid exists (which it does, as samba-ad-dc has an active smbd process), and tries to reload the (disabled) smbd service, which subsequently fails. Relevant logrotate error output: /etc/cron.daily/logrotate: smbd.service is not active, cannot reload. error: error running non-shared postrotate script for /var/log/samba/log.smbd of '/var/log/samba/log.smbd ' run-parts: /etc/cron.daily/logrotate exited with return code 1 In summary, this file should probably still be rotated (as the samba-ad-dc smbd process logs to it), but the samba-ad-dc service should be reloaded instead of the smbd service. The following patch fixes the situation. The code is based on the existing config for the /var/log/samba/log.samba file. --- /etc/logrotate.d/samba 2018-03-05 14:30:11.000000000 +0100 +++ samba 2018-08-12 11:44:44.926253127 +0200 @@ -3,7 +3,11 @@ missingok rotate 7 postrotate - [ ! -f /var/run/samba/smbd.pid ] || /etc/init.d/smbd reload > /dev/null + if [ -d /run/systemd/system ] && command systemctl >/dev/null 2>&1 && systemctl is-active --quiet samba-ad-dc; then + systemctl kill --kill-who all --signal=SIGHUP samba-ad-dc + elif [ -f /var/run/samba/smbd.pid ]; then + /etc/init.d/smbd reload > /dev/null + fi endscript compress delaycompress -- System Information: Debian Release: 9.5 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-7-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=locale: Cannot set LC_ALL to default locale: No such file or directory UTF-8), LANGUAGE=en_US:en (charmap=locale: Cannot set LC_ALL to default locale: No such file or directory UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages samba depends on: ii adduser 3.115 ii dpkg 1.18.25 ii init-system-helpers 1.48 ii libbsd0 0.8.3-1 ii libc6 2.24-11+deb9u3 ii libldb1 2:1.1.27-1+b1 ii libpam-modules 1.1.8-3.6 ii libpam-runtime 1.1.8-3.6 ii libpopt0 1.16-10+b2 ii libpython2.7 2.7.13-2+deb9u2 ii libtalloc2 2.1.8-1 ii libtdb1 1.3.11-2 ii libtevent0 0.9.31-1 ii libwbclient0 2:4.5.12+dfsg-2+deb9u2 ii lsb-base 9.20161125 ii procps 2:3.3.12-3+deb9u1 ii python 2.7.13-2 ii python-dnspython 1.15.0-1 ii python-samba 2:4.5.12+dfsg-2+deb9u2 ii python2.7 2.7.13-2+deb9u2 ii samba-common 2:4.5.12+dfsg-2+deb9u2 ii samba-common-bin 2:4.5.12+dfsg-2+deb9u2 ii samba-libs 2:4.5.12+dfsg-2+deb9u2 ii tdb-tools 1.3.11-2 ii update-inetd 4.44 Versions of packages samba recommends: ii attr 1:2.4.47-2+b2 ii logrotate 3.11.0-0.1 ii samba-dsdb-modules 2:4.5.12+dfsg-2+deb9u2 ii samba-vfs-modules 2:4.5.12+dfsg-2+deb9u2 Versions of packages samba suggests: ii bind9 1:9.10.3.dfsg.P4-12.3+deb9u4 ii bind9utils 1:9.10.3.dfsg.P4-12.3+deb9u4 pn ctdb <none> pn ldb-tools <none> pn ntp | chrony <none> pn smbldap-tools <none> pn ufw <none> ii winbind 2:4.5.12+dfsg-2+deb9u2 -- debconf information excluded
--- End Message ---
--- Begin Message ---Version: 2:4.6.5+dfsg-6 Le dim. 12 août 2018 à 11:57, Yannik <[email protected]> a écrit : > > Package: samba > Version: 2:4.5.12+dfsg-2+deb9u2 > Severity: normal > > Dear Maintainer, Hi, Thanks for this report. > I'm using samba 4 in AD mode. Therefore, smbd and nmbd services are > disabled, and the samba-ad-dc service is enabled. > > The logrotate conf included with samba (/etc/logrotate.d/samba) > only checks if a smbd pid exists (which it does, as samba-ad-dc > has an active smbd process), and tries to reload the (disabled) > smbd service, which subsequently fails. Indeed. > [...] > > --- /etc/logrotate.d/samba 2018-03-05 14:30:11.000000000 +0100 > +++ samba 2018-08-12 11:44:44.926253127 +0200 > @@ -3,7 +3,11 @@ > missingok > rotate 7 > postrotate > - [ ! -f /var/run/samba/smbd.pid ] || /etc/init.d/smbd reload > > /dev/null > + if [ -d /run/systemd/system ] && command systemctl >/dev/null > 2>&1 && systemctl is-active --quiet samba-ad-dc; then > + systemctl kill --kill-who all --signal=SIGHUP > samba-ad-dc > + elif [ -f /var/run/samba/smbd.pid ]; then > + /etc/init.d/smbd reload > /dev/null > + fi > endscript > compress > delaycompress This kind of fix unfortunately won't go in a stable release. This is however fixed in sid. This file has seen a lot of changes since stretch: https://salsa.debian.org/samba-team/samba/commits/master/debian/samba.logrotate. Can you confirm that this version (the current sid) works for you? https://salsa.debian.org/samba-team/samba/blob/7c183619f7e2d2b3fb280da605ea944874791fa2/debian/samba.logrotate I'm closing this bug in the relevant version. Regards -- Mathieu Parent
--- End Message ---

