You are not logged in.
I've solved my original problem by using systemd-timesyncd instead of ntpd. But I'd love to know why systemd is unable to start ntp.service:
I first installed ntpd with
sudo pacman -S ntp
I rebooted.
but then:
~:0$ sudo systemctl enable ntp.service
Failed to enable unit: Unit file ntp.service does not exist.
~:0$ sudo systemctl list-unit-files | grep ntp
ntpd.service disabled disabled
ntpdate.service disabled disabled
~:0$ ls -l /usr/lib/systemd/system/ntpd.service
-rw-r--r-- 1 root root 246 Jul 1 2020 /usr/lib/systemd/system/ntpd.service
~:0$ systemctl show -p UnitPath --no-p
UnitPath=/etc/systemd/system.control /run/systemd/system.control /run/systemd/transient /run/systemd/generator.early /etc/systemd/system /etc/systemd/system.attached /run/systemd/system /run/systemd/system.attached /run/systemd/generator /usr/local/lib/systemd/system /usr/lib/systemd/system /run/systemd/generator.late
~:0$ sudo pacman -Qkk systemd
backup file: systemd: /etc/systemd/resolved.conf (Modification time mismatch)
backup file: systemd: /etc/systemd/resolved.conf (Size mismatch)
backup file: systemd: /etc/systemd/resolved.conf (MD5 checksum mismatch)
backup file: systemd: /etc/systemd/resolved.conf (SHA256 checksum mismatch)
warning: systemd: /var/log/journal (GID mismatch)
systemd: 1904 total files, 1 altered file
~:1$ md5sum /usr/lib/systemd/system/ntpd.service
77d51b701d417aeb2e8911e24287496e /usr/lib/systemd/system/ntpd.service
~:0$ cat /usr/lib/systemd/system/ntpd.service
[Unit]
Description=Network Time Service
After=network.target nss-lookup.target
Conflicts=systemd-timesyncd.service
[Service]
Type=forking
PrivateTmp=true
ExecStart=/usr/bin/ntpd -g -u ntp:ntp
Restart=always
[Install]
WantedBy=multi-user.target
I can run ntpd directly with
sudo /usr/bin/ntpd -g -u ntp:ntp
and ntpd seems happy.
Any idea why systemctl seems in conflict with itself over whether this unit exists?
Last edited by quoin (2024-03-23 16:47:18)
Offline
As you wrote, it's "ntpd.service", not " ntp.service".
Offline
Whenever in doubt, always Wiki it first
https://wiki.archlinux.org/title/Networ … pd_at_boot
Last edited by Ammako (2021-10-31 13:07:36)
Offline
As you wrote, it's "ntpd.service", not " ntp.service".
I think could have looked at this another hour and not seen that.
Thank you!
Agh
Offline
Whenever in doubt, always Wiki it first
Thank you
You do realize whenever you post these comments on tech forums that half the time people *did* start at <place you're supposed to look>, spent an hour cursing their computer, and still got it wrong?-)
Offline
I don't see how the wiki would help here. Sure, it says "ntpd.service", but if you fail to spot that "d" in all the command output in the first post, why would you not fail to spot it in the wiki?
quoin, please edit you first post and prepend [SOLVED] to the title.
Offline
You do realize whenever you post these comments on tech forums that half the time people *did* start at <place you're supposed to look>, spent an hour cursing their computer, and still got it wrong?-)
No, I don't. I'm not a psychic and I cannot know this kind of thing unless the person asking the question tells us.
Offline