logrotate rules do not allow for samba being disabled.

Bug #1760855 reported by Gordon Lack
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
samba (Debian)
Fix Released
Unknown
samba (Ubuntu)
Fix Released
Low
Andreas Hasenack

Bug Description

The logrotate rules for log.smbd and log.nmbd assume that if /usr/bin/smbcontrol can be run then samba can be restarted.
This ignores the fact that it is possible to have samba installed, but to have it disabled (you may wish to only enable it for running tests, then disable it again).
The result is:

    /etc/cron.daily/logrotate:
    Can't find pid for destination 'smbd'
    error: error running non-shared postrotate script for /var/log/samba/log.smbd of '/var/log/samba/log.smbd '
    Can't find pid for destination 'nmbd'
    error: error running non-shared postrotate script for /var/log/samba/log.nmbd of '/var/log/samba/log.nmbd '
    run-parts: /etc/cron.daily/logrotate exited with return code 1

Given that it may be disabled it would also make sense to include "notifempty" in the rules. so that past ones don't get removed.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: samba 2:4.6.7+dfsg-1ubuntu3.2
ProcVersionSignature: Ubuntu 4.13.0-37.42-generic 4.13.13
Uname: Linux 4.13.0-37-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
CurrentDesktop: KDE
Date: Tue Apr 3 13:34:00 2018
InstallationDate: Installed on 2017-11-19 (135 days ago)
InstallationMedia: Kubuntu 17.10 "Artful Aardvark" - Release amd64 (20171017.1)
RelatedPackageVersions:
 nautilus N/A
 gvfs 1.34.1-1ubuntu1
SambaClientRegression: Yes
SourcePackage: samba
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.logrotate.d.samba: 2017-11-26T00:56:36.795055

Related branches

Revision history for this message
Gordon Lack (gordon-lack) wrote :
Revision history for this message
Gordon Lack (gordon-lack) wrote :

Ignore the attached modified conffile - I'm reporting this from a different system to the one I've fixed this on.

Revision history for this message
Gordon Lack (gordon-lack) wrote :

A modified postrotate rules that works is:

        postrotate
                if systemctl -q is-enabled smbd && [ -x /usr/bin/smbcontrol ]; then
                        /usr/bin/smbcontrol smbd reload-config
                else
                        /bin/true
                fi
        endscript

(similarly for nmbd).

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Thanks for this bug report. It does sound like a good fix to have.

Changed in samba (Ubuntu):
status: New → Triaged
importance: Undecided → Low
tags: added: server-next
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'm hoping to soon collect all these small (and some not so small) samba bugs in one big swoop and fix them with a single SRU.

tags: added: bite-size
removed: server-next
Changed in samba (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Andreas Hasenack (ahasenack)
Changed in samba (Debian):
status: Unknown → New
Changed in samba (Debian):
status: New → Fix Committed
Changed in samba (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was fixed in 2:4.8.4+dfsg-2ubuntu1

Changed in samba (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.