[LinuxPPS] systemd & ldattach

Udo van den Heuvel udovdh at xs4all.nl
Sat Apr 20 10:07:35 CEST 2013


On 2012-11-22 15:31, Udo van den Heuvel wrote:
> 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?

That doesn't always work.
So after asking Lennart Poettering about this it was suggested that I
make a separate service file for ldattach in /usr/lib/systemd/system/

# cat ldattach at ttyS2.service
[Unit]
Description=Line Discipline for GPS Timekeeping for %i
Before=ntpd.service

[Service]
ExecStart=/sbin/ldattach 18 /dev/%i
Type=forking

[Install]
WantedBy=multi-user.target


Then we can do:

# systemctl enable ldattach at ttyS2.service
ln -s '/usr/lib/systemd/system/ldattach at ttyS2.service'
'/etc/systemd/system/multi-user.target.wants/ldattach at ttyS2.service'
# service ldattach at ttyS2 start
Redirecting to /bin/systemctl start  ldattach at ttyS2.service
# ls -l /dev/pps*
crw-rw---- 1 root tty 254, 0 Apr 20 10:02 /dev/pps0
#

Comments?




More information about the discussions mailing list