Bug 237999

Summary: rc.d/ntpd cannot fetch NTPD leap-seconds file via a proxy
Product: Base System Reporter: Boris Korzun <drtr0jan>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: mail, peterpramb
Priority: ---    
Version: 11.2-STABLE   
Hardware: Any   
OS: Any   

Description Boris Korzun 2019-05-20 12:25:14 UTC
The ntpd script supports ntpd_env option (and ntpd_env_file in 12.0-STABLE). But ntpd_fetch_leapfile() subroutine doesn't support ntpd_env option.

So it's impossible to fetch the leapfile via a proxy (HTTP_PROXY variable for the fetch).
Comment 1 mail 2020-02-19 13:35:14 UTC
(In reply to Boris Korzun from comment #0)

Hi Boris,

Were you ever able to fix this "nicely"?

We have a couple of FreeBSD 12.1 hosts that rely on a proxy for their internet access. They suffer from this issue as well.

Kind regards,

Comment 2 Peter Pramberger 2020-10-16 08:59:50 UTC
The workaround mentioned in https://forums.freebsd.org/threads/set-proxy-server-for-rc-d-periodic-scripts.69664/post-418020 was a good starting point, but unfortunately I was not able to get 'ntpd_env' working.

There is however 'ntpd_env_file' (at least in 12) to source external files, which works perfectly:


export http_proxy

Just make sure that the referenced file is readable, and usable by sh(1).

Would prefer a more generic way though, instead of changing the environment for every service needing external access.
Comment 3 Peter Pramberger 2020-10-16 10:02:47 UTC
(In reply to Peter Pramberger from comment #2)

Sorry, I missed that 'ntpd_env_file' was already mentioned - for me it works that way.