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

Bug #1579597 reported by Paul Ruiz on 2016-05-09
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
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) on 2016-05-09
tags: added: xenial
Launchpad Janitor (janitor) wrote :

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

Changed in samba (Ubuntu):
status: New → Confirmed
Nish Aravamudan (nacc) on 2016-08-24
Changed in samba (Ubuntu):
status: Confirmed → Triaged

@ Nish Aravamudan

You forgot to set importance and to nominate for series!

Changed in samba (Ubuntu):
importance: Undecided → High
Jeremy Green (jgreen210) wrote :

Looks like debian have bug and fix for this:

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

Andreas Hasenack (ahasenack) wrote :

That debian fix doesn't address this issue unfortunately.

tags: added: server-next
tags: added: bite-size
Andreas Hasenack (ahasenack) wrote :

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

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
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
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  Edit
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.