You are not logged in.

#1 2021-10-31 11:08:03

quoin
Member
Registered: 2021-02-08
Posts: 15

[SOLVED] systemctl thinks "Unit file ntp.service does not exist."

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

#2 2021-10-31 11:18:59

icar
Member
From: Catalunya
Registered: 2020-07-31
Posts: 520

Re: [SOLVED] systemctl thinks "Unit file ntp.service does not exist."

As you wrote, it's "ntpd.service", not " ntp.service".

Offline

#3 2021-10-31 13:07:23

Ammako
Member
Registered: 2021-07-16
Posts: 267

Re: [SOLVED] systemctl thinks "Unit file ntp.service does not exist."

Whenever in doubt, always Wiki it first wink

https://wiki.archlinux.org/title/Networ … pd_at_boot

Last edited by Ammako (2021-10-31 13:07:36)

Offline

#4 2021-11-02 09:33:35

quoin
Member
Registered: 2021-02-08
Posts: 15

Re: [SOLVED] systemctl thinks "Unit file ntp.service does not exist."

icar wrote:

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

#5 2021-11-02 09:35:45

quoin
Member
Registered: 2021-02-08
Posts: 15

Re: [SOLVED] systemctl thinks "Unit file ntp.service does not exist."

Ammako wrote:

Whenever in doubt, always Wiki it first wink

https://wiki.archlinux.org/title/Networ … pd_at_boot

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

#6 2021-11-02 11:23:13

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] systemctl thinks "Unit file ntp.service does not exist."

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

#7 2021-11-02 21:29:44

Ammako
Member
Registered: 2021-07-16
Posts: 267

Re: [SOLVED] systemctl thinks "Unit file ntp.service does not exist."

quoin wrote:

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

Board footer

Powered by FluxBB