我有以下新贵的工作:
# hwclock - adjust system clock and timezone
#
# The hwclock task adjusts the system clock when the hardware clock is
# set to localtime (e.g. when dual-booting with Windows), and also
# ensures that the system timezone is set so that timestamps are written
# to FAT devices.
description "adjust system clock and timezone"
start on starting mountall
task
script
exec hwclock --systz --utc --noadjfile
end script
我想将此切换到 systemd 服务。
在 systemd 上应该如何start on starting mountall
实现?
我创建了如下的 systemd 服务,但我不知道该怎么做start on starting mountall
。
[Unit]
Description=hwclock
After=
Before=
[Service]
ExecStart=/sbin/hwclock --systz --utc --noadjfile
您将需要这些行:
如此处所述:
结构应该是:
从这里:
注意:这适用于 Ubuntu 系统,但应该类似。另见:https ://www.freedesktop.org/software/systemd/man/systemd.unit.html 。