ports/net/chrony/files/chronyd.in
Matthias Andree f7c8a6233b net/chrony: dns/dnsmasq: change rcfile ordering
Make sure that these services start in proper order, and sooner
such that chrony can synchronize time before other services need it.

Note that there is a circular dependency or bootstrapping problem
here in that the system time needs to be halfway correct if you
require your time servers to be looked up through DNS with DNSSEC
enabled because crypto usually needs correct clocks for expiration
checks on signatures to work so the name service needs a correct time,
and looking up the time server needs a working name service.

So be sure you can bootstrap with a skewed time.

Reported by:	Lexi Winter
PR:		282566

I am not MFHing this, it's too intrusive.
2024-12-08 16:19:40 +01:00

32 lines
710 B
Bash

#!/bin/sh
# PROVIDE: chronyd
# REQUIRE: SERVERS
# KEYWORD: nojail shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# chronyd_enable (bool): Set it to "YES" to enable chronyd
# Default is "NO"
# chronyd_config (str): Set full path to configuration file.
# Default is "%%PREFIX%%/etc/chrony.conf"
# chronyd_flags (str): Flags passed to chronyd(8)
# Default is ""
#
. /etc/rc.subr
name=chronyd
rcvar=chronyd_enable
load_rc_config ${name}
: ${chronyd_enable:="NO"}
: ${chronyd_config:="%%PREFIX%%/etc/chrony.conf"}
command=%%PREFIX%%/sbin/${name}
command_args="-f \"${chronyd_config}\""
required_files="${chronyd_config}"
run_rc_command "$1"