svn commit: r335575 - head/etc/rc.d
Ian Lepore
ian at FreeBSD.org
Sat Jun 23 02:42:09 UTC 2018
Author: ian
Date: Sat Jun 23 02:42:08 2018
New Revision: 335575
URL: https://svnweb.freebsd.org/changeset/base/335575
Log:
Use 'mv -f' in rc.d/ntpd to avoid spuriously halting the boot.
The final 'mv' to install a fetched leap-list file can fail (due to a
readonly fs, or schg flags, for example), and that leads to mv(1)
prompting the user, stopping the boot process. Instead, use mv -f
to supress the prompting, and if verbose mode is on, emit a warning
that the existing file cannot be replaced.
PR: 219255
Modified:
head/etc/rc.d/ntpd
Modified: head/etc/rc.d/ntpd
==============================================================================
--- head/etc/rc.d/ntpd Sat Jun 23 01:42:34 2018 (r335574)
+++ head/etc/rc.d/ntpd Sat Jun 23 02:42:08 2018 (r335575)
@@ -148,7 +148,8 @@ ntpd_fetch_leapfile() {
"$ntp_expiry_tmp" -eq "$ntp_expiry_db" -a \
"$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then
$verbose using $url as $ntp_db_leapfile
- mv $ntp_tmp_leapfile $ntp_db_leapfile
+ mv -f $ntp_tmp_leapfile $ntp_db_leapfile ||
+ $verbose "warning: cannot replace $ntp_db_leapfile (read-only fs?)"
else
$verbose using existing $ntp_db_leapfile
fi
More information about the svn-src-head
mailing list