Bug 245399 - net/chrony: rc.d script broken (always thinks chronyd is not running)
Summary: net/chrony: rc.d script broken (always thinks chronyd is not running)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Matthias Andree
URL:
Keywords: regression
Depends on:
Blocks: 244534
  Show dependency treegraph
 
Reported: 2020-04-06 14:34 UTC by Peter Putzer
Modified: 2020-04-14 14:35 UTC (History)
0 users

See Also:
mandree: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Putzer 2020-04-06 14:34:37 UTC
The new rc.d script always thinks chronyd is not running (but does notice the PID file).

$ service chronyd status
chronyd is not running.

$ service chronyd start
Starting chronyd.
Another chronyd may already be running (pid=30960), check /var/run/chronyd.pid
/usr/local/etc/rc.d/chronyd: WARNING: failed to start chronyd

$ ps auxw|grep chronyd
chronyd  30960   0.0  0.0   15612    3256  -  I    16:31        0:00.01 /usr/local/sbin/chronyd -f /usr/local/etc/chrony.conf
root     30963   0.0  0.0   12060    2796  -  I    16:31        0:00.00 /usr/local/sbin/chronyd -f /usr/local/etc/chrony.conf
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2020-04-06 16:07:46 UTC
Hi Peter,

I cannot reproduce this with a default configuration,
and the pidfile you get reported from chronyd appears nonstandard, 
both per chrony.conf as well as the port's default and sample files.

The rc script uses /var/run/chrony/chronyd.pid, not /var/run/chronyd.pid.

Please remove your pidfile directive, or change it to the default.

Thank you.
Comment 2 Matthias Andree freebsd_committer freebsd_triage 2020-04-06 16:08:22 UTC
...comment out, change or remove pidfile from /usr/local/etc/chrony.conf
Comment 3 Peter Putzer 2020-04-06 16:21:57 UTC
(In reply to Matthias Andree from comment #2)

Thanks, that fixed. The chrony.conf file has been like that forever - it was not a problem before, so maybe an UPDATING notice would be warranted? (Or at least a comment somewhere in the sample config.)
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-04-06 16:28:28 UTC
A commit references this bug:

Author: mandree
Date: Mon Apr  6 16:27:49 UTC 2020
New revision: 530887
URL: https://svnweb.freebsd.org/changeset/ports/530887

Log:
  net/chrony: fix regression, remove pidfile= from rc.d script

  chrony handles its own pidfile, and still our status method works,
  so avoid missing chrony's own lock management.

  PR:		245399
  Reported by:	Peter Putzer

Changes:
  head/net/chrony/Makefile
  head/net/chrony/files/chronyd.in
Comment 5 Matthias Andree freebsd_committer freebsd_triage 2020-04-06 16:28:42 UTC
Peter, thanks for the update, I think _1 should not have set pidfile= because that wasn't necessary and doesn't work in your situation. _2 removes that.
Comment 6 Matthias Andree freebsd_committer freebsd_triage 2020-04-06 16:30:19 UTC
Inform Colin T. about the regression by way of adding a blocks on his BZ PR 244534.
Comment 7 Colin T. 2020-04-14 14:35:53 UTC
I personally don't recommend changing the pidfile from the default. As chronyd won't be able to remove it on exit.