Bug 1216822

Summary: Remove dhclient-script from dhcp-client package
Product: [openSUSE] openSUSE Tumbleweed Reporter: Petr Vorel <petr.vorel>
Component: NetworkAssignee: Jorik Cronenberg <jorik.cronenberg>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dimstar, jorik.cronenberg, kukuk, mt, petr.vorel
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
See Also: https://bugzilla.suse.com/show_bug.cgi?id=1216814
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Petr Vorel 2023-11-02 13:46:22 UTC
According to the comments in dhclient-script [1] we ship, the script is not used neither by NetworkManager nor wicked:

# Note:
#   It is used by sysconfig alias netcontrol alias ifup-dhcp,
#   but not by the NetworkManager that is using an own script.
#
#   Wicked is using an another dhcp client (runtime conflict).
#   As sysconfig-network is gone on sles12 and opensuse > 13.1,
#   this script is obsolete and unsupported.

[1] https://build.opensuse.org/package/view_file/network:dhcp/dhcp/dhclient-script?expand=1

Also, it requires usleep from deprecated sysvinit-tools, which is not addressed.

Both of these were pointed out by #1216814. Therefore suggesting to remove the script from the package instead.
Comment 1 Petr Vorel 2023-11-02 13:56:00 UTC
Working on SR to remove the script.
Comment 2 Petr Vorel 2023-11-02 14:29:23 UTC
https://build.opensuse.org/request/show/1122768
Comment 3 Marius Tomaschewski 2023-11-03 19:01:39 UTC
I add my 2cent here as bug 1216814 has been resolved already.

(In reply to Petr Vorel from bug 1216814 comment #3)
> Replaced by https://bugzilla.suse.com/show_bug.cgi?id=1216822.
> 
> @Marius feel free to reopen this and close #1216822 if it should be kept.

I'm not maintaining ISC dhcp any more since SLE-12, but the current
maintainer is assigned here + obs request and will review it.

(In reply to Thorsten Kukuk from bug 1216814 comment #1)
> (In reply to Petr Vorel from bug 1216814 comment #0)
> > I'm not sure if NetworkManager or wicked use /sbin/dhclient-script
> 
> Nobody is using it, it's unsupported:
> 
> # Note:
> #   It is used by sysconfig alias netcontrol alias ifup-dhcp,
> #   but not by the NetworkManager that is using an own script.
> #
> #   Wicked is using an another dhcp client (runtime conflict).
> #   As sysconfig-network is gone on sles12 and opensuse > 13.1,
> #   this script is obsolete and unsupported.
> 
> 
> > but if we ship it, it should work.
> 
> We should not ship scripts which are obsolete, unsupported and
> unused by our stack.
> So it should be removed from dhcp-client package.

Yes, it's not used by NetworkManager, wicked or systemd-networkd.

> > i.e. we should add dependency to sysvinit-tools, which contains usleep.
> 
> This will not pass any review, as sysvinit-tools is clearly deprecated.

Note: I don't vote to keep it! -> maintainers decision.

I remember some discussion at SLE-12(?) times with some maintainer
after me and the reason he decided to not remove it was, that it
worked [or rejects to run logging error why not] and it is nice to
have an "emergency standalone dhcp client" for manual use, e.g.
in a rescue system.

Beside the usleep issue now, it IMO still works on sle11..sle15
(all sle11 sysconfig artifacts could be cleaned up, but do not
 hurt as they're caught/guarded as needed).

It would be possible to replace `usleep 25000` with `sleep 0.25`.
Don't remember when sleep started to accept values < 1s, but it
was already before SLE-12 .. it works on SLE-12-SP2 and later.
Comment 4 Petr Vorel 2023-11-03 20:19:58 UTC
We have in LTP special tool tst_sleep, thus I did expect it
would not work, but now I see it works in coreutils implementation. Checking
busybox sleep, it requires to be configured with FEATURE_FANCY_SLEEP [1]
to have float number support. This was likely reason for LTP to not rely on
this sleep functionality, but we can expect coreutils everywhere in openSUSE.
And just for sure I would also add it as Requires.

I'll wait for the maintainer resolution, whether remove entirely or use
"sleep 0.25".

[1] https://git.busybox.net/busybox/tree/coreutils/sleep.c
Comment 5 Jorik Cronenberg 2023-11-14 12:39:52 UTC
Hi, sorry for the late response.
For Factory I would lean more towards removing it. Though I'm not sure from reading everything here, did you, Petr, come up on this issue because you have a use for this script? Because if you do, I would also be fine to fix it via "sleep 0.25".
Comment 6 Petr Vorel 2023-11-15 09:45:00 UTC
No, I don't have use for this script. Only two LTP tests use it via their library [1], but this is not a real use. It's really up to you if I should put "sleep 0.25" or remove the script entirely.

[1] https://github.com/linux-test-project/ltp/blob/master/testcases/network/dhcp/dhcp_lib.sh
Comment 7 Jorik Cronenberg 2023-11-22 10:58:54 UTC
With https://build.opensuse.org/request/show/1127733 accepted, dhclient-script is now removed from Factory.
Comment 8 Dominique Leuenberger 2023-12-07 10:12:45 UTC
(In reply to Jorik Cronenberg from comment #7)
> With https://build.opensuse.org/request/show/1127733 accepted,
> dhclient-script is now removed from Factory.

This actually resulted in a failure exposed in openQA - where dhclient is used directly (without wicked or NetworkManager)

In a debug run, I added -v to the dhclient call, which resulted in

+ dhclient -v -pf dhclient.pid -lf dhclient.lease wlan1
Internet Systems Consortium DHCP Client 4.4.2-P1
Copyright 2004-2021 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

execve (/sbin/dhclient-script, ...): No such file or directory
dnsmasq is up.
Listening on LPF/wlan1/a6:5f:87:13:63:89
Sending on   LPF/wlan1/a6:5f:87:13:63:89
Sending on   Socket/fallback
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 5 (xid=0x1d05d0e5)
DHCPOFFER of 192.168.202.197 from 192.168.202.1
DHCPREQUEST for 192.168.202.197 on wlan1 to 255.255.255.255 port 67  (xid=0x1d05d0e5)
DHCPACK of 192.168.202.197 from 192.168.202.1 (xid=0x1d05d0e5)
execve (/sbin/dhclient-script, ...): No such file or directory
bound to 192.168.202.197 -- renewal in 1544 seconds.

as dhclinet-script does not exist, the IP 'bound' is never applied to the NIC


The debug test is https://openqa.opensuse.org/tests/3789167#step/wpa_supplicant/42 (for reference)


The test code being run is
https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/data/wpa_supplicant/wpa_supplicant_test.sh

The current installation of 'dhclient' seems to effectively be broken with the removal of this script now, isn't it?
Comment 9 Jorik Cronenberg 2023-12-07 13:09:36 UTC
Ah I wasn't aware that by default ISC ship their own dhclient-script which is under client/scripts/linux in the tarball. We could try seeing if this one works, but I think it's better to just revert the scripts deletion and fix it with "sleep 0.25". I'll open a SR.
Comment 10 OBSbugzilla Bot 2023-12-07 14:25:02 UTC
This is an autogenerated message for OBS integration:
This bug (1216822) was mentioned in
https://build.opensuse.org/request/show/1131616 Factory / dhcp
Comment 11 Petr Vorel 2023-12-14 09:43:57 UTC
(In reply to Dominique Leuenberger from comment #8)
> (In reply to Jorik Cronenberg from comment #7)
> > With https://build.opensuse.org/request/show/1127733 accepted,
> > dhclient-script is now removed from Factory.
> 
> This actually resulted in a failure exposed in openQA - where dhclient is
> used directly (without wicked or NetworkManager)

BTW What I understood from Marius and Jorik, that nobody is actually using dhclient standalone (I haven't used if for ages), but maybe we were wrong.

SR#1131616 has been accepted, let's close this.