Bug 243469

Summary: net/ntimed daemon command does not use "-r"
Product: Ports & Packages Reporter: karl
Component: Individual Port(s)Assignee: Mark Felder <feld>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (feld)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description karl 2020-01-20 13:59:17 UTC
The net/ntimed package/port rc script does not use the "-r" flag on the daemon command by default.

This would not normally be a problem if the package itself did not exit on start under some temporary conditions, but it does.  Specifically, if the network is not yet available (e.g. the machine boots before the upstream router to the Internet does, thus there is no resolver available) ntimed will exit on an error and, since daemon was not told to restart it if that happens, you now have no time sync and there's no particular indication to the user that it happened other than the error on the console shortly after the boot.

IMHO the default should be to restart it; if you have asked for time sync by loading this as a lightweight client (instead of ntpd, for instance) you probably mean it.
Comment 1 commit-hook freebsd_committer 2020-02-08 16:04:31 UTC
A commit references this bug:

Author: feld
Date: Sat Feb  8 16:04:14 UTC 2020
New revision: 525559
URL: https://svnweb.freebsd.org/changeset/ports/525559

Log:
  net/ntimed: Supervise process and attempt to drop privs

  PR:		243469

Changes:
  head/net/ntimed/Makefile
  head/net/ntimed/files/ntimed.in
Comment 2 Mark Felder freebsd_committer 2020-02-08 16:05:37 UTC
Thanks for the feedback Karl. I also recently had my first ntimed crash and I'm not sure what caused it after several years of use.

New port update will now restart automatically on failure and it also attempts to use the mac_ntpd on newer FreeBSD releases to drop privileges and run as ntpd user instead of root.