Results 1 to 4 of 4

Thread: seemed to have found a bug in 21-dhcpcd-hook-samba script (fix provided in the post

  1. #1
    Join Date
    Mar 2011
    Location
    Waterloo, Ontario, Canada
    Posts
    44

    Default seemed to have found a bug in 21-dhcpcd-hook-samba script (fix provided in the post

    Code:
    HostLeaseFiles="/var/lib/dhcp/dhclient-${interface}.lease /var/run/dhclient-${interface}.lease /var/lib/dhcp/dhclient-${interface}.leases"
    	unset new_netbios_name_servers WINSSERVERS NETBIOSSCOPE
    	for HostInfo in ${HostInfoFiles}; do
    		if test -r ${HostInfo}; then
    			break
    		fi
    	done
    ...
    Code:
    	if [ -n "${HostInfo}" -o -n "${HostLease}" ]; then
    		if test "${HostInfo}" -nt "${HostLease}"; then
    			source "${HostInfo}"
    			OLD_IFS=${IFS}
    			IFS=','
    			for server in "${WINSSERVERS} ${NETBIOSNAMESERVER}"; do
    				new_netbios_name_servers="${new_netbios_name_servers} ${server}"
    			done
    			IFS=${OLD_IFS}
    		elif test "${HostLease}" -nt "${HostInfo}"; then
    			eval $( awk 'BEGIN { FS="[[:blank:];]*" } /netbios-name-servers/ { netbios_name_servers=$4 }; /netbios-scope/ { netbios_scope=$4 } END { print "new_netbios_name_servers=\"" netbios_name_servers "\"\nNETBIOSSCOPE=" netbios_scope}' "${HostLease}")
    		else
    			log_err "No dhcpcd info nor dhclient leases file found for ${interface}."
    		fi
    	fi
    notice how in the first part of code
    the HostLeaseFiles reads files in "/var/lib/dhcp/dhclient-${interface}.lease"
    this is wrong
    $(interface) only returns the name/type of the network (eth0, eth1 or wlan0 and so on)
    on the other hand, the real lease file located in /var/lib/dhcp is called "dhclient-A-Bunch-of-Hexa-Code-${interface}.lease"

    so, due to wrong file name, hostlease file isnt found and results in the error of "No dhcpcd info nor dhclient leases file found for ${interface}" in /var/log/messages, as script executes
    Code:
    log_err "No dhcpcd info nor dhclient leases file found for ${interface}."
    from the second part of the code

    hence, in order to fix this
    Code:
    /var/lib/dhcp/dhclient-${interface}.lease
    needs to be changed to
    Code:
    /var/lib/dhcp/dhclient-*-${interface}.lease
    now, u wont see that annoying error message anymore
    openSUSE 11.4
    HP MINI-210: Intel Atom N550, HD3150 Graphics, 1GB RAM

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: seemed to have found a bug in 21-dhcpcd-hook-samba script (fix provided in the post

    So this information seems to be very interesting. When searching on the location of the file: 21-dhcpcd-hook-samba I found that it exists in the folder /etc/sysconfig/network/if-up.d & /etc/sysconfig/network/if-down.d thought they seem to actually be the very same file as when you edit one it changes the other.

    You must be a root user to edit this file. The line "/var/lib/dhcp/dhclient-${interface}.lease" does exist twice, but another line "/var/lib/dhcp/dhclient-${interface}.leases" exists with only the difference being an added s at the end. Is this second reference OK?

    Any way, just trying to following your suggested modifications and where these files are located.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3
    Join Date
    Mar 2011
    Location
    Waterloo, Ontario, Canada
    Posts
    44

    Default Re: seemed to have found a bug in 21-dhcpcd-hook-samba script (fix provided in the post

    oh yes, i believe those other files should also have * in between dhclient- and -${interface}

    however, on my machine, i ve never seen those files in those directories being ever created
    so i just left it unchanged

    --------------------------------------------------
    in fact, i just found that there is a file called dhclient-${interface}.leases (${interface} may be eth1 eth0, or wlan0, for me its eth1)
    and there is no hexa-code in between dhclient and ${interface}. so im assuming this is only the problem with files end with .lease, but not .leases
    openSUSE 11.4
    HP MINI-210: Intel Atom N550, HD3150 Graphics, 1GB RAM

  4. #4
    Join Date
    Nov 2010
    Location
    BEIJING,CHINA; SHANGHAI,CHINA
    Posts
    219

    Default 回复: seemed to have found a bug in 21-dhcpcd-hook-samba script (fix provided in the post

    it's been so long, but yes, I just submit your fix to our samba-client package. in 12.3 it'll go away
    Describe questions in details. Google the 'broken application + error message' first

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •