"/etc/dhcp/dhclient-enter-hooks.d/samba returned non-zero exit status 1" when samba.service is disabled

Bug #1579597 reported by Paul Ruiz
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Fix Released
Low
Andreas Hasenack
Nominated for Xenial by Alberto Salvia Novella

Bug Description

/etc/dhcp/dhclient-enter-hooks.d/samba should check that smbd.service is enabled and running || exit without continuing.

May 9 01:26:46 foo1 dhclient[911]: DHCPACK of 10.10.1.47 from 10.10.1.33
May 9 01:26:46 foo1 systemd[1]: smbd.service: Unit cannot be reloaded because it is inactive.
May 9 01:26:46 foo1 root: /etc/dhcp/dhclient-enter-hooks.d/samba returned non-zero exit status 1
May 9 01:26:46 foo1 dhclient[911]: bound to 10.10.1.47 -- renewal in 1547 seconds.

Paul Ruiz (paul-ruiz)
tags: added: xenial
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
Nish Aravamudan (nacc)
Changed in samba (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

@ Nish Aravamudan

You forgot to set importance and to nominate for series!

Changed in samba (Ubuntu):
importance: Undecided → High
Revision history for this message
Jeremy Green (jgreen210) wrote :

Looks like debian have bug and fix for this:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801976

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

That debian fix doesn't address this issue unfortunately.

tags: added: server-next
tags: added: bite-size
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

We can use systemctl is-enabled smbd.service for this.

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

Quick test:

        # reload the samba server
        # We don't necessarily have the samba package installed. #414841
        if systemctl is-enabled smbd.service --quiet; then
                systemctl reload smbd.service
        fi

I just have to understand if we can use systemctl all the way here, or if I have to check for sysv, upstart and systemd, and choose one.

Changed in samba (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
importance: High → Low
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
samba (2:4.5.8+dfsg-2ubuntu2) artful; urgency=medium

  * Add extra DEP8 tests to samba (LP: #1696823):
    - d/t/control: enable the new DEP8 tests
    - d/t/smbclient-anonymous-share-list: list available shares anonymously
    - d/t/smbclient-authenticated-share-list: list available shares using
      an authenticated connection
    - d/t/smbclient-share-access: create a share and download a file from it
    - d/t/cifs-share-access: access a file in a share using cifs
  * Ask the user if we can run testparm against the config file. If yes,
    include its stderr and exit status in the bug report. Otherwise, only
    include the exit status. (LP: #1694334)
  * If systemctl is available, use it to query the status of the smbd
    service before trying to reload it. Otherwise, keep the same check
    as before and reload the service based on the existence of the
    initscript. (LP: #1579597)
  * Remove d/p/fix-1584485.patch as it builds a broken pam_winbind
    module. There is a fixed version of that patch attached to
    #1677329 but it has not been vetted yet, so for now it's best
    to revert (again) so that pam_winbind can be used.
    (LP: #1677329, LP: #1644428)

 -- Andreas Hasenack <email address hidden> Mon, 19 Jun 2017 10:49:29 -0700

Changed in samba (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Eliezer Croitoru (eliezer) wrote :

Can it be backported to xenial?
Currently I patched the with:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=801976;filename=samba.dhclient-hook.diff;msg=5

but it should be fixed for the lts version.

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.