#1028962 isc-dhcp-client: -x option no longer works (looks like apparmor configuration prevents it from having any effect)

Package:
isc-dhcp-client
Source:
isc-dhcp-client
Description:
DHCP client for automatically obtaining an IP address
Submitter:
Francesco Poli (wintermute)
Date:
2026-08-05 17:33:06 UTC
Severity:
normal
Tags:
#1028962#5
Date:
2023-01-15 10:53:37 UTC
From:
To:
Hello and thanks for maintaining ISC DHCP in Debian!

After upgrading packages ('isc-dhcp-client' itself or other libraries),
it may happen that

  # checkrestart

(from the 'debian-goodies' package) tells me that an instance of dhclient
should be restarted.

One option is bringing down the corresponding network interface and then
bringing it up again:

  # ifdown $NETWORK_INTERFACE ; ifup $NETWORK_INTERFACE

This works (well, used to work, see below...), but has some drawbacks:
it leaves the box briefly without network, if all goes well; if something
goes wrong, it leaves the box without network, until something else is
done to fix the issue (and it could be troublesome, if you are
administering the box through an SSH session from a distant remote host...);
it may cut existing network connections down; and so forth...

A long time ago, I found what seems to be a better strategy.
First of all, figure out the exact command line for dhclient:

  # ps aux | grep dhclien[t]
  root         738  0.0  0.0   5868  3604 ?        Ss   09:37   0:00 /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s25.pid -lf /var/lib/dhcp/dhclient.enp0s25.leases -I -df /var/lib/dhcp/dhclient6.enp0s25.leases enp0s25

Then, stop dhclient without releasing the current lease (as documented in
the dhclient(8) man page):

  # /sbin/dhclient -x -pf /run/dhclient.enp0s25.pid

Finally start dhclient again with the previously found command line:

  # /sbin/dhclient -4 -v -i -pf /run/dhclient.enp0s25.pid -lf /var/lib/dhcp/dhclient.enp0s25.leases -I -df /var/lib/dhcp/dhclient6.enp0s25.leases enp0s25

This used to work without any network down-time, looked more failsafe and
even quicker.


Unfortunately, this second strategy no longer seems to work.
When I issue the dhclient command with the "-x" option, nothing happens
and dhclient goes on running.

I noticed the following line in /var/log/kern.log :

  2023-01-15T11:29:18.045334+01:00 $HOSTNAME kernel: [ 6692.708089] audit: type=1400 audit(1673778558.040:25): apparmor="DENIED" operation="signal" profile="/{,usr/}sbin/dhclient" pid=7192 comm="dhclient" requested_mask="send" denied_mask="send" signal=term peer="unconfined"

It seems to me that the AppArmor configuration in /etc/apparmor.d/sbin.dhclient
is preventing the "-x" option from having any useful effect.

I am not familiar with AppArmor, but I think that this operation should
be somehow possible, otherwise the AppArmor configuration makes the "-x"
option (almost) completely useless.

Moreover, even the first strategy (ifdown/ifup) now seems to fail to
work perfectly. After issueing the following command:

  # ifdown $NETWORK_INTERFACE ; ifup $NETWORK_INTERFACE

I see that two dhclient istances are running (the previously existing
one, and a new one). And I see the same error in /var/log/kern.log .
Hence, I have to manually kill the previous instance:

  # kill -TERM $OLD_DHCLIENT_PID


All this seems to be extremely annoying and inconvenient.

Please note that I set severity "important" for this bug report,
but one could even claim that this is "grave". Especially taking
into account that ifdown does not stop the running DHCP client...


Please fix the AppArmor configuration or suggest an alternative strategy
to stop the DHCP client without releasing the current lease.
And anyway, please fix the package, so that ifdown works correctly!

Bye and thanks for your time and dedication!

#1028962#10
Date:
2023-01-16 13:28:05 UTC
From:
To:
Hello Francesco,

El 15/01/23 a las 11:53, Francesco Poli (wintermute) escribió:

Thanks for your bug report!

I am not able to reproduce this with my current setup. I can
successfully run dhclient -x and it stops the related process.

Anyway, could you please test the attached patch?
...

Do you see the same apparmor DENIED messages?

Cheers,

#1028962#17
Date:
2023-01-16 22:38:31 UTC
From:
To:
On Mon, 16 Jan 2023 14:28:05 +0100 Santiago Ruano Rincón wrote:

[...]

Nor am I!     :-o

I tried again today and now I can also use the "-x" option and the
"ifdown" command, as well, without any unexpected behavior.

That's really awkward.
What's different in my box, with respect to yesterday?!?

There have been other package upgrades, of course, but no one looks
related to AppArmor or to isc-dhcp-client.

There has been a poweroff and a boot (well, actually, two of them, if I
recall correctly), but we are talking about Debian GNU/Linux here, not
about That Other Operating System™ that needs to be rebooted for each
and every little trifle!    ;-)
Hence I would be a little surprised, if it turned out that the reboot
helped...

What else could have changed the result?

Thanks for preparing the patch, but I am not going to test it for the
time being, since I am currently unable to reproduce the bug...

[...]

Yes, I saw the same AppArmor error message in /var/log/kern.log, when I
tried ifdown yesterday.

Somehow everything seems to work flawlessly today.

Hence, I am tagging this bug report as 'unreproducible' and leaving the
'moreinfo' tag.
If I don't come back with additional information for some time, please
feel free to close the bug report.

And many thanks for your prompt and kind reply!
Bye.    :-)

#1028962#24
Date:
2026-08-05 17:31:09 UTC
From:
To:
Dear submitter,

as the package isc-dhcp has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1143544

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)