mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 00:15:07 -05:00
examples: add systemd services
This commit is contained in:
17
examples/chrony-wait.service
Normal file
17
examples/chrony-wait.service
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Wait for chrony to synchronize system clock
|
||||||
|
After=chronyd.service
|
||||||
|
Requires=chronyd.service
|
||||||
|
Before=time-sync.target
|
||||||
|
Wants=time-sync.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
# Wait up to ~10 minutes for chronyd to synchronize and the remaining
|
||||||
|
# clock correction to be less than 0.1 seconds
|
||||||
|
ExecStart=/usr/bin/chronyc waitsync 60 0.1
|
||||||
|
RemainAfterExit=yes
|
||||||
|
StandardOutput=null
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
13
examples/chronyd.service
Normal file
13
examples/chronyd.service
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=NTP client/server
|
||||||
|
After=ntpdate.service sntp.service ntpd.service
|
||||||
|
Conflicts=ntpd.service systemd-timesyncd.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/var/run/chronyd.pid
|
||||||
|
EnvironmentFile=-/etc/sysconfig/chronyd
|
||||||
|
ExecStart=/usr/sbin/chronyd $OPTIONS
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user