Update dhcpcd to 5.0.2
Changes from 5.0.1 include * -n option now starts dhcpcd if not already started * 29-lookup-hostname hook installed by default, but skipped in dhcpcd.conf * Fix warning about missing dirs if we don't have any existing state * Fix compile on some Linux distros re linux/wireless.h
This commit is contained in:
parent
d009a1bb6c
commit
05cc3e1e56
|
@ -48,6 +48,7 @@ build_resolv_conf()
|
|||
|
||||
# Assemble resolv.conf using our head and tail files
|
||||
[ -f "$cf" ] && rm -f "$cf"
|
||||
[ -d "$resolv_conf_dir" ] || mkdir -p "$resolv_conf_dir"
|
||||
echo "$header" > "$cf"
|
||||
if [ -f /etc/resolv.conf.head ]; then
|
||||
cat /etc/resolv.conf.head >> "$cf"
|
||||
|
@ -101,9 +102,7 @@ add_resolv_conf()
|
|||
if [ -e "$resolv_conf_dir/$interface" ]; then
|
||||
rm -f "$resolv_conf_dir/$interface"
|
||||
fi
|
||||
if [ ! -d "$resolv_conf_dir" ]; then
|
||||
mkdir -p "$resolv_conf_dir"
|
||||
fi
|
||||
[ -d "$resolv_conf_dir" ] || mkdir -p "$resolv_conf_dir"
|
||||
printf "$conf" > "$resolv_conf_dir/$interface"
|
||||
build_resolv_conf
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
# Detect OpenRC or BSD rc
|
||||
# Distributions may want to just have their command here instead of this
|
||||
if type rc-service >/dev/null 2>&1 && rc-service --exists ntpd; then
|
||||
ntpd_restart_cmd="rc-service ntpd -- --ifstarted --quiet restart"
|
||||
ntpd_restart_cmd="rc-service ntpd -- -Ds restart"
|
||||
elif [ -x /etc/rc.d/ntpd ]; then
|
||||
ntpd_restart_cmd="/etc/rc.d/ntpd status && /etc/rc.d/ntpd restart"
|
||||
ntpd_restart_cmd="/etc/rc.d/ntpd status >/dev/null 2>&1 && /etc/rc.d/ntpd restart"
|
||||
elif [ -x /usr/local/etc/rc.d/ntpd ]; then
|
||||
ntpd_restart_cmd="/usr/local/etc/rc.d/ntpd status && /usr/local/etc/rc.d/ntpd restart"
|
||||
ntpd_restart_cmd="/usr/local/etc/rc.d/ntpd status >/dev/null 2>&1 && /usr/local/etc/rc.d/ntpd restart"
|
||||
fi
|
||||
|
||||
ntp_conf_dir="$state_dir/ntp.conf"
|
||||
|
@ -47,6 +47,7 @@ build_ntp_conf()
|
|||
|
||||
# Merge our config into ntp.conf
|
||||
[ -e "$cf" ] && rm -f "$cf"
|
||||
[ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
|
||||
remove_markers "$signature_base" "$signature_base_end" \
|
||||
"$ntp_conf" > "$cf"
|
||||
if [ -n "$servers" ]; then
|
||||
|
|
|
@ -1596,31 +1596,31 @@ main(int argc, char **argv)
|
|||
PACKAGE " will not work correctly unless run as root");
|
||||
|
||||
if (sig != 0) {
|
||||
i = -1;
|
||||
pid = read_pid();
|
||||
if (pid != 0)
|
||||
syslog(LOG_INFO, "sending signal %d to pid %d",
|
||||
sig, pid);
|
||||
|
||||
if (!pid || (i = kill(pid, sig))) {
|
||||
if (pid == 0 || kill(pid, sig) != 0) {
|
||||
if (sig != SIGALRM)
|
||||
syslog(LOG_ERR, ""PACKAGE" not running");
|
||||
unlink(pidfile);
|
||||
if (sig != SIGALRM)
|
||||
exit(EXIT_FAILURE);
|
||||
} else {
|
||||
if (sig == SIGALRM)
|
||||
exit(EXIT_SUCCESS);
|
||||
/* Spin until it exits */
|
||||
syslog(LOG_INFO, "waiting for pid %d to exit", pid);
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 100000000; /* 10th of a second */
|
||||
for(i = 0; i < 100; i++) {
|
||||
nanosleep(&ts, NULL);
|
||||
if (read_pid() == 0)
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
syslog(LOG_ERR, "pid %d failed to exit", pid);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (sig == SIGALRM)
|
||||
exit(EXIT_SUCCESS);
|
||||
/* Spin until it exits */
|
||||
syslog(LOG_INFO, "waiting for pid %d to exit", pid);
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 100000000; /* 10th of a second */
|
||||
for(i = 0; i < 100; i++) {
|
||||
nanosleep(&ts, NULL);
|
||||
if (read_pid() == 0)
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
syslog(LOG_ERR, "pid %d failed to exit", pid);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!(options & DHCPCD_TEST)) {
|
||||
|
|
|
@ -13,3 +13,7 @@ option ntp_servers
|
|||
# However, a lot of buggy DHCP servers set invalid MTUs so this is not
|
||||
# enabled by default.
|
||||
#option interface_mtu
|
||||
|
||||
# We provide a hook script to lookup the hostname if not set by the DHCP
|
||||
# server, but we should not run it by default.
|
||||
nohook lookup-hostname
|
||||
|
|
Loading…
Reference in New Issue