[Main]
Type = classic
Version = 0.1.0
Description = "chrony daemon"
User = ( root )
Depends = ( mount-rw )
Options = ( log )

[Start]
Execute = (
	# chronyd in foreground (-d), matching debian/sv/chrony.
	
	envfile -I /etc/default/chrony
	importas -sCuD "-F 1" DAEMON_OPTS DAEMON_OPTS
	
	foreground {
		ifelse { install -d -m 0750 -o _chrony -g _chrony /run/chrony } { }
		install -d -m 0755 /run/chrony
	}
	
	exec /usr/sbin/chronyd ${Args} ${DAEMON_OPTS}
)

[Logger]
RunAs = s6log
Backup = 3
MaxSize = 2000000
Timestamp = tai
Destination = /var/log/chrony-s6

[Environment]
Args = !-d
