New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to acquire DHCP IP in 58-start-dhclient.sh #1274
Comments
@styerd There have been some adaptions and enhancements Regarding specifically ReaR 1.17.2 on RHEL 7.2 |
We had briefly tried with "USE_DHCLIENT" but that didn't work either and we haven't debugged in that path. In this path we find that clearing "DEVICE, DEVICETYPE, and REALDEVICE inside the "for dev in |
@styerd Could you explain a bit more in detail what you mean with clearing "DEVICE, DEVICETYPE, and REALDEVICE inside the "for dev in get_device_by_hwaddr" and making the pid file parameter unique in 58-start-dhclient.sh results in starting dhclient on each interface which seems to be the intention of this code. I see what you mean with the pid file... |
@gdha /usr/share/rear/skel/default/etc/scripts/system-setup.d/58-start-dhclient.sh
The needed change to keep dhclient from failing is:
@styerd Is that correct? |
This is only part of the problem. As coded “$DEVICE” never changes in the loop.
I wonder if invoking “dhclient” with no DEVICE parameter wouldn’t do what is intended which seems to be to initiate DHCP on every interface.
That in fact is our current work around, to remove the loop.
|
Probably nothing that needs to be done for ReaR 2.3 |
Changed label 'minor bug' to 'enhancement' as it is not really a bug (it doesn't break the rescue system). Not urgent to fix so change milestone '2.4' to 'future' |
Having the same issue when trying to perform a restore from a from a machine with multiple interfaces (all dhcp). The first call to "dhclient" seems to work and the interface is receiving an IP. All following calls to dlclient fail. I believe the missing "${DEVICE}" in the pid-file name is causing the dhclient to exit with the "already running" error. Ensuring a seperat pid-file for each dhclinet instance should fix this issue. |
With the committed PRs this issue can be closed |
Relax-and-Recover (ReaR) Issue Template
Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):
OUTPUT=PXE
OUTPUT_URL=nfs://172.17.5.2/var/lib/tftpboot/rear
BACKUP=NETFS
BACKUP_URL=nfs://172.17.5.2/var/lib/tftpboot/rear
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/var/tmp' '/var/crash'
'/erambr.log*' '/backup_restore.ksh.log*'
'/etc/sysconfig/network-scripts/ifcfg-et*'
'/etc/sysconfig/network-scripts/ifcfg-en*')
On occasion our HP Proliant ML30 Gen9 reorders the interfaces as shown by "ip addr show" and the NFS mount fails with "network unreachable". In that case no network interfaces are configured which prompted a closer look. In "58-start-dhclient.sh" the following behavior was noted:
Press ENTER to run 58-start-dhclient.sh
++ dhclient -lf /var/lib/dhclient/dhclient.leases.eno1 -pf /var/run/dhclient.pid -cf /etc/dhclient.conf eno1
++ dhclient -lf /var/lib/dhclient/dhclient.leases.eno1 -pf /var/run/dhclient.pid -cf /etc/dhclient.conf eno1
dhclient(519) is already running - exiting.
++ dhclient -lf /var/lib/dhclient/dhclient.leases.eno1 -pf /var/run/dhclient.pid -cf /etc/dhclient.conf eno1
dhclient(519) is already running - exiting.
++ dhclient -lf /var/lib/dhclient/dhclient.leases.eno1 -pf /var/run/dhclient.pid -cf /etc/dhclient.conf eno1
dhclient(519) is already running - exiting.
++ dhclient -lf /var/lib/dhclient/dhclient.leases.eno1 -pf /var/run/dhclient.pid -cf /etc/dhclient.conf eno1
dhclient(519) is already running - exiting.
++ dhclient -lf /var/lib/dhclient/dhclient.leases.eno1 -pf /var/run/dhclient.pid -cf /etc/dhclient.conf eno1
dhclient(519) is already running - exiting.
This actually is the functioning case since eno1 did in fact acquire an IP address and that interface is up. In the failure case ens2f0 is listed first and so replaces all instances of "eno1" above but there is no server available there and no cable attached. It appears that perhaps this code was intended to start dhclient on each interface which likely would work if the device changed for each invocation and also the '-pf' parameter was changed to avoid the "already running" complaint. As coded '$DEVICE' never changes.
A simple work around was to replace all this with a simple "dhclient" invocation which without parameters tries to acquire IPs on all interfaces. Perhaps we should specify "USE_DHCIENT=y" but the existing configuration was working for us most of the time.
The text was updated successfully, but these errors were encountered: