mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 05:36:38 +02:00
- checkconfig only checked for a required_file and did nothing else - vrf= support is in openrc itself - set rundir to /run/chrony instead of /var/run (symlink) - use default declarative functions
32 lines
879 B
Bash
32 lines
879 B
Bash
#!/sbin/openrc-run
|
|
|
|
command="/usr/sbin/chronyd"
|
|
description="NTP daemon"
|
|
pidfile="/run/chrony/chronyd.pid"
|
|
required_files="$CFGFILE"
|
|
command_args="-f $CFGFILE $ARGS"
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
provide ntp-client ntp-server
|
|
use dns
|
|
}
|
|
|
|
start() {
|
|
if [ -c /dev/rtc ]; then
|
|
grep -q '^rtcfile' "${CFGFILE}" && command_args="$command_args -s"
|
|
fi
|
|
grep -q '^dumponexit$' "${CFGFILE}" && command_args="$command_args -r"
|
|
if yesno "$FAST_STARTUP"; then
|
|
# this option makes it stay in foreground and let openrc do the tracking,
|
|
# so we have to set pidfile to a dir that exists earlier.
|
|
# the reason this is not the default is because there is no 'readiness',
|
|
# self-backgrounding chrony waits for time to sync before continuing,
|
|
# and this form does not.
|
|
command_args="$command_args -n"
|
|
command_background=true
|
|
pidfile=/run/chronyd.pid
|
|
fi
|
|
default_start
|
|
}
|