Index: etc/rc.d/ntpd =================================================================== --- etc/rc.d/ntpd +++ etc/rc.d/ntpd @@ -55,9 +55,30 @@ rm -f "${ntpd_chrootdir}/dev/clockctl" ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) fi - ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift ln -fs "${ntpd_chrootdir}${ntp_tmp_leapfile}" ${ntp_tmp_leapfile} + # For each ntpd cmdline option that takes a file or dir as an argument, + # create a symlink into the cage at the corresponding outside location, + # if there isn't a file or symlink at that location already. Silently + # ignore errors (there might be a readonly filesystem involved) since + # this is only a convenience and not required for operation. + set -- $rc_flags + while [ $# -gt 1 ]; do + case "$1" in + -c | --configfile | \ + -f | --driftfile | \ + -k | --keyfile | \ + -l | --logfile | \ + -s | --statsdir ) + if [ ! -e "$2" ]; then + ln -fhs "${ntpd_chrootdir}/$2" "$2" 2>/dev/null + fi + shift + ;; + esac + shift + done + # Change run_rc_commands()'s internal copy of $ntpd_flags # rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags"