HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //etc.defaults/init/dhcp-client.conf
description "configure DHCP client"

normal exit SIGKILL
console log
respawn
respawn limit 3 30

instance $IFACE

pre-start script
	# For support #1282570, #1178031 and #752074
	# In case rtc get wrong system time less than 1970/01/01 cause dhclient abort
	year=$(date +%Y)
	if [ "$year" -lt 1970 ]; then
		date -s "2018/01/01" || true
	fi

	if [ ! -f /var/run/dhclient-script ]; then
		cp -f /etc/dhclient/dhclient-script /var/run/dhclient-script || true
	fi
	if [ -f /etc/dhclient/ipv4/dhcpv4.leases.$IFACE ]; then
		cp -f /etc/dhclient/ipv4/dhcpv4.leases.$IFACE /tmp/dhcpv4.leases.$IFACE
	fi
end script

exec /usr/sbin/dhclient -4 -d -q -lf /tmp/dhcpv4.leases.$IFACE -pf /tmp/dhcpcd-$IFACE.pid -sf /var/run/dhclient-script $IFACE

post-start script
	/usr/bin/logger -t dhcp-client -p err "started on $IFACE" || true
end script

post-stop script
	/usr/bin/logger -t dhcp-client -p err "stopped on $IFACE" || true
	if [ -f /tmp/dhcpv4.leases.$IFACE ]; then
		cp -f /tmp/dhcpv4.leases.$IFACE /etc/dhclient/ipv4/dhcpv4.leases.$IFACE
	fi
end script
# vim:ft=upstart