Hi Michael,

Am 09.12.2016 um 12:43 schrieb Michael Chapman:
On Fri, 9 Dec 2016, Michael Chapman wrote:
[...]
You will need to use the .service extension on at least the first of
those links. systemd will only consider links in that directory that
have valid unit names. (I'm pretty sure the intermediate link's name
doesn't matter, but I wouldn't want to rely on that -- best just to
use valid full unit names everywhere.)

Oh, something else I thought of... I'm pretty sure it doesn't make sense
having a symlink to /dev/null inside a .wants directory. Really, only
the name of those links are considered. The links aren't actually
dereferenced.

I have to disagree on this, the name does not matter, the link target does matter (see log below, the relevant status is marked with <---).

If I create a link named foo pointing to /lib/systemd/system/systemd-timesyncd.service the service is enabled and started. If I delete the link, the service is disabled and not started. Everything is fine. But it requires write access to /etc.

If I create a link structure like this:

/etc/systemd/system/sysinit.target.wants/systemd-timesyncd ->
/mnt/writeable/systemd-timesyncd ->
/lib/systemd/system/systemd-timesyncd.service

the service is also started (Good).

But if I then change the structure to

/etc/systemd/system/sysinit.target.wants/systemd-timesyncd ->
/mnt/writeable/systemd-timesyncd ->
/dev/null

timedatectl still says "NTP is enabled".

And at this point I don't know how to proceed.

Best regards,
André

Log:

$ ssh [email protected]
Password:

root@apalis-imx6:~# rm /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service

root@apalis-imx6:~# reboot
Connection to 192.168.16.14 closed by remote host.

$ ssh [email protected]
Password:

root@apalis-imx6:~# systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service;
   disabled; vendor preset: enabled)                              <---
   Active: inactive (dead)
     Docs: man:systemd-timesyncd.service(8)

root@apalis-imx6:~# timedatectl
      Local time: Fri 2016-12-09 13:20:46 UTC
  Universal time: Fri 2016-12-09 13:20:46 UTC
        RTC time: n/a
       Time zone: Universal (UTC, +0000)
     NTP enabled: no                                              <----
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

root@apalis-imx6:~# cd /etc/systemd/system/sysinit.target.wants/
root@apalis-imx6:/etc/systemd/system/sysinit.target.wants# mount-rw /
root@apalis-imx6:/etc/systemd/system/sysinit.target.wants# ln -s /lib/systemd/system/systemd-timesyncd.service foo
root@apalis-imx6:/etc/systemd/system/sysinit.target.wants# ll foo
lrwxrwxrwx 1 root root 45 Dec 9 13:21 foo -> /lib/systemd/system/systemd-timesyncd.service

root@apalis-imx6:/etc/systemd/system/sysinit.target.wants# reboot
Connection to 192.168.16.14 closed by remote host.

$ ssh [email protected]
Warning: Permanently added '192.168.16.14' (ECDSA) to the list of known hosts.
Password:

root@apalis-imx6:~# systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service;
   enabled; vendor preset: enabled)                                 <---
   Active: inactive (dead)
     Docs: man:systemd-timesyncd.service(8)

root@apalis-imx6:~# timedatectl
      Local time: Fri 2016-12-09 13:21:51 UTC
  Universal time: Fri 2016-12-09 13:21:51 UTC
        RTC time: n/a
       Time zone: Universal (UTC, +0000)
     NTP enabled: yes                                               <---
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

root@apalis-imx6:~#
_______________________________________________
systemd-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to