Re: [chrony-users] How to Delay Chrony Start Until After PPS Device Attached

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


I have the following file in /etc/init.d and have systemd run it bootup.
note that it should not matter if the gps/pps unit is not attached at bootup--
it just means that ldattach sees no signals until it is.
But it would be better if it were attached always and chrony were started up
at bootup, as otherwise it could take a while for chrony to actually get the
clock into sync.

Also ups pps is not terribly accurate. UPS has no pps line. It had to get sent
as a ups message and then get converted to a signal by software ( which all
takes a while). Of course it depends on whataccuracy you want.



gps
----------------------------------------------------------
#! /bin/sh
#
# gps Support for NTP serial gps clock. #
# chkconfig: 345 70 15
# description: gps is a module to read the PPS from a serial port
#
# # processname: gps

# Get config.
.. /etc/sysconfig/network

# Get functions
.. /etc/rc.d/init.d/functions

module="gps"
device="gps"
mode="664"
group=wheel

echo gsp $1 >>/tmp/gps

# See how we were called.
case "$1" in

start)
	  echo "Starting gps pps service"
	  modprobe pps-ldisc
	  ldattach 18 /dev/ttyS0
     ;;

stop)
	echo "Stopping gps pps service"
     killall ldattach
	;;

status)
	status ldattach
	;;

restart)
	$0 stop
        $0 start
	;;

*)
	echo "gps wildcard">>/tmp/gps
	gprintf "Usage: gps {start|stop|status|restart}\n "
	exit 1
	;;
esac

exit 0
------------------------------------------------------------------



William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____ unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1 ____|____ and Gravity ______|_    theory.physics.ubc.ca/

On Fri, 8 Dec 2023, Joshua Quesenberry wrote:

[CAUTION: Non-UBC Email]

Good Evening,

I'm pulling a 1PPS signal into my system over a USB to Serial device's
DCD pin; I don't have a typical RS232 port available. In order to fire
up the PPS line discipline on startup and to create a relably named
symlink to the created /dev/pps* (of which there are multiple
generated by PTP also) I'm using a combination of UDEV rules and a
pps_setup@.service service file. In my chrony.conf I'm giving it an
entry that looks for the PPS signal at the reliably named symlink (eg.
/dev/my_pps). The problem I'm running into now is that this device
isn't ready on startup before Chrony is started and therefore Chrony
is choking, so my hope is that some of you all have run into a similar
setup before and have recommendations on how to proceed? Is it
possible for me to set a couple second delay in starting Chrony to
give the device time to be available? Is there a way to make Chrony
not die and rather keep retrying to connect while continuing to use
other time sources in the interim? This would be ideal in case for
some reason the device never became available, such as being
accidentally unplugged.

Thanks!

Josh Q

--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.



--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject. For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/