Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6-0]: src/etc/rc.d The new ntpd wants to translate ntp into a por...



details:   https://anonhg.NetBSD.org/src/rev/dc122b08655e
branches:  netbsd-6-0
changeset: 775033:dc122b08655e
user:      he <he%NetBSD.org@localhost>
date:      Sun Dec 28 17:07:26 2014 +0000

description:
The new ntpd wants to translate ntp into a port number after chroot,
so give it its own small copy of /etc/services in the chroot.
[mlelstv, ticket 1223]

diffstat:

 etc/rc.d/ntpd |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 163517caa179 -r dc122b08655e etc/rc.d/ntpd
--- a/etc/rc.d/ntpd     Thu Dec 25 02:56:18 2014 +0000
+++ b/etc/rc.d/ntpd     Sun Dec 28 17:07:26 2014 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ntpd,v 1.13 2004/08/13 18:08:03 mycroft Exp $
+# $NetBSD: ntpd,v 1.13.58.1 2014/12/28 17:07:26 he Exp $
 #
 
 # PROVIDE: ntpd
@@ -49,6 +49,21 @@
        fi
        ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift
 
+       if [ ! -d "${ntpd_chrootdir}/etc" ]; then
+               mkdir "${ntpd_chrootdir}/etc"
+       fi
+       if [ ! -f "${ntpd_chrootdir}/etc/services" ]; then
+               getent services ntp/udp ntp/tcp \
+                       > "${ntpd_chrootdir}/etc/services"
+       fi
+       if [ ! -d "${ntpd_chrootdir}/var/db" ]; then
+               mkdir -p "${ntpd_chrootdir}/var/db"
+       fi
+       if [ ! -f "${ntpd_chrootdir}/var/db/services.cdb" ]; then
+               services_mkdb -o "${ntpd_chrootdir}/var/db/services.cdb" \
+                       "${ntpd_chrootdir}/etc/services"
+       fi
+
        #       Change run_rc_commands()'s internal copy of $ntpd_flags
        #
        rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags"



Home | Main Index | Thread Index | Old Index