/etc/localtime is used by glibc but not uclibc which uses /etc/TZ. openntpd builds fine on a uclibc system, but pkg_config() fails because it assumes /etc/localtime exists and it may not. The assumption in pkg_config() behind the hard linking is dangerous because /etc/localhost may not exist for any number of reasons. My recommendation is to remove the die from this line: cp "${EROOT%/}"/etc/localtime "${EROOT%/}${NTP_HOME}"/etc/localtime || die and guard it in an if statement which, if it fails, alerts the user to manually copy localtime to "${EROOT%/}${NTP_HOME}"/etc/localtime. Reproducible: Always
This whole copying around localtime thing pre-dates me. I guess there was some ancient bug that said ntpd syslog output wasn't in the right timezone because it couldn't access /etc/localtime in the chroot. I wasn't able to reproduce that failure but left the legacy stuff in. I don't think we need it anymore: # rm -rf /var/lib/openntpd/chroot/etc # strace -f /usr/sbin/ntpd -f /etc/ntpd.conf 2>/tmp/ntp.out # egrep 'chroot|localtime|clone' /tmp/ntp.out open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2294, ...}) = 0 clone(Process 18931 attached clone(Process 18932 attached [pid 18932] clone(Process 18933 attached [pid 18932] stat("/var/lib/openntpd/chroot", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 [pid 18932] chroot("/var/lib/openntpd/chroot" <unfinished ...> [pid 18932] <... chroot resumed> ) = 0 ntpd only accesses /etc/localtime before the chroot occurs. I think we should just just rip the copy out of the ebuild and clean up any localtime found in an existing chroot during an update. I'll put together a new ebuild and attach.
Sounds good to me!
Created attachment 406484 [details] New ebuild cleaning up localtime copy
Created attachment 406486 [details, diff] patch ebuild from 5.7_p4 to 5.7_p4-r1
+*openntpd-5.7_p4-r1 (12 Jul 2015) + + 12 Jul 2015; Christoph Junghans <ottxor@gentoo.org> + +openntpd-5.7_p4-r1.ebuild: + fixed uclibc compatibility (bug #554434) +