ansible/roles/i2c-clock/files/etc/systemd/system/rtc-i2c.service

21 lines
510 B
SYSTEMD
Raw Normal View History

2021-01-25 18:50:37 +00:00
[Unit]
ConditionCapability=CAP_SYS_TIME
ConditionVirtualization=!container
DefaultDependencies=no
Wants=dev-rtc_i2c.device
After=dev-rtc_i2c.device
Before=systemd-timesyncd.service ntpd.service chrony.service
[Service]
Type=oneshot
CapabilityBoundingSet=CAP_SYS_TIME
PrivateTmp=yes
ProtectSystem=full
ProtectHome=yes
DeviceAllow=/dev/rtc_i2c rw
DevicePolicy=closed
2021-03-09 10:33:26 +00:00
ExecStartPre=/usr/bin/echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
ExecStart=/sbin/hwclock -s
2021-01-25 18:50:37 +00:00
[Install]
WantedBy=time-sync.target