[LinuxPPS] systemd & ldattach

Udo van den Heuvel udovdh at xs4all.nl
Thu Nov 22 15:31:37 CET 2012


On 2012-10-19 08:28, Udo van den Heuvel wrote:
> How to elegantly hack the `ldattach 18 /dev/ttySx &` into an environment
> that doesn't use the SysV scripts but systemd?
> Basically, if /dev/ppsX does not exist ldattach should be run before
> ntpd is started.
> 
> Anyone?

Something like:
ntp.service:

[Unit]
Description=ntpd

[Service]
ExecStartPre= /bin/bash -c '[[ -c /dev/pps0 ]] && /…bin/ldattach 18
/dev/ttyS2 &’
ExecStart=/usr/sbin/ntpd -n

[Install]
WantedBy=multi-user.target


But... systemd does not like backgrounded processes like this, if I read
correctly.
Also udev has similar ideas about reality.

So would it work if we set the `ldattach 18 /dev/ttyS2 &` in rc.local
and hope that the executaion of rc.local is before ntpd.service?

Udo




More information about the discussions mailing list