Samba logrotate script uses invalid argument to /etc/init.d/nmdb

Bug #1385868 reported by Josh Holland
132
This bug affects 31 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Confirmed
Medium
Unassigned
samba (Ubuntu)
Fix Released
Medium
Unassigned
Wily
Fix Released
Medium
Unassigned

Bug Description

* Impact
the logrotate script uses an invalid reload syntax

* Test case
install samba, rotate the log, look at errors emails

* Impact
the command used now is the debian one, it should work, still check it reloads the service as it should

--------------------

I received the following in an email from Anacron:

/etc/cron.daily/logrotate:
Usage: /etc/init.d/nmbd {start|stop|restart|force-reload|status}
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

On further investigation I found that the problem lies in the /etc/logrotate.d/samba file:

/var/log/samba/log.nmbd {
 weekly
 missingok
 rotate 7
 postrotate
  service nmbd reload 2>/dev/null
 endscript
 compress
 notifempty
}

where the postrotate script specifies a "reload", which the init script does not recognise.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: samba 2:4.1.11+dfsg-1ubuntu2
ProcVersionSignature: Ubuntu 3.16.0-23.31-generic 3.16.4
Uname: Linux 3.16.0-23-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Oct 26 12:36:21 2014
InstallationDate: Installed on 2014-05-30 (148 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
OtherFailedConnect: Yes
SambaServerRegression: No
SmbConfIncluded: No
SourcePackage: samba
UpgradeStatus: Upgraded to utopic on 2014-10-18 (8 days ago)

Revision history for this message
Josh Holland (jshholland) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in samba (Ubuntu):
status: New → Confirmed
Changed in hundredpapercuts:
status: New → Confirmed
Changed in samba (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
importance: Undecided → Medium
Revision history for this message
Dominique Ramaekers (dominique-ramaekers) wrote :

It's still there in Vivid...

Revision history for this message
jimav (james-avera) wrote :

Also confirm it's happening on vivid (15.04) - get an email from Anacron cron.daily after rebooting.

Revision history for this message
GuyR (guy-rouger) wrote :

Same problem in Xubuntu 15.04
/etc/cron.daily/logrotate:
Usage: /etc/init.d/nmbd {start|stop|restart|force-reload|status}
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

Revision history for this message
Simon Arlott (sa.me.uk) wrote :

This can be fixed in the debian/samba.logrotate script by doing smbd and nmbd at the same time and using "smbcontrol all reload-config". This command doesn't return an error if the services aren't running.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-Use-smbcontrol-for-log-rotation.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
elatllat (elatllat) wrote :

Ubuntu seems more sloppy and ess responsive than debian... maybe it's time they accepted more community help.

Revision history for this message
Robie Basak (racb) wrote :

@elatllat

We'd love more community help! Please see https://wiki.ubuntu.com/SponsorshipProcess for details on getting this into the sponsorship queue. Keep in mind that submitted patches may not necessarily be suitable - sometimes they aren't the correct fix, might regress other users, or should be sent to Debian instead rather than increase the maintenance burden in Ubuntu. But if it's appropriate, a patch pilot processing the sponsorship queue will apply it.

Thanks again for volunteering!

tags: added: vivid wiley
removed: utopic
tags: added: wily
removed: wiley
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, indeed that's an issue introduced when switching away from upstart, I've changed the package back to use the Debian version of the script, which works, and forwarded them your suggested change on https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804705

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:4.1.20+dfsg-1ubuntu2

---------------
samba (2:4.1.20+dfsg-1ubuntu2) xenial; urgency=medium

  * debian/samba.logrotate:
    - revert to Debian version of the logrotate reload command, fix an
      invalid syntax introduced in the upstart->systemd transition
      (lp: #1385868)

 -- Sebastien Bacher <email address hidden> Tue, 10 Nov 2015 19:01:06 +0100

Changed in samba (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Josh, or anyone else affected,

Accepted samba into wily-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/samba/2:4.1.17+dfsg-4ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in samba (Ubuntu Wily):
importance: Undecided → Medium
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Sebastien Bacher (seb128) wrote :

seems to done the job

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:4.1.17+dfsg-4ubuntu3

---------------
samba (2:4.1.17+dfsg-4ubuntu3) wily; urgency=medium

  * debian/samba.logrotate:
    - revert to Debian version of the logrotate reload command, fix an
      invalid syntax introduced in the upstart->systemd transition
      (lp: #1385868)

 -- Sebastien Bacher <email address hidden> Tue, 10 Nov 2015 19:04:30 +0100

Changed in samba (Ubuntu Wily):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for samba has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.