Bug 243469 - net/ntimed daemon command does not use "-r"
Summary: net/ntimed daemon command does not use "-r"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-20 13:59 UTC by karl
Modified: 2020-02-08 16:05 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (feld)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.