[ntp:questions] What is the NTP recovery time from 16s step in GPS server?

David Taylor david-taylor at blueyonder.co.uk.invalid
Wed Oct 31 18:48:06 UTC 2012


On 31/10/2012 18:35, Rob wrote:
[]
> I don't know much about the raspberry.

Snap!

> I think it is sort of standard Linux, but then there really is no
> standard Linux anymore due to all the silly changes that Ubuntu people
> have been bringing.

Yes, the multiple variations was one of the reasons I didn't pursue 
Linux development - I don't have the time to support so many versions.

> What does the /etc/rc.d/gpsd file look like as it is now?

It's in /etc/int.d/gpsd, and I'll put it at the end of this post.

> Is there a /etc/udev/rules.d/ directory with some .rules files in it?

Yes, there are two:

pi at raspberrypi /etc/udev/rules.d $ cat 40-scratch.rules
ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0003", SUBSYSTEMS=="usb", 
ACTION=="add", MODE="0666", GROUP="plugdev"

pi at raspberrypi /etc/udev/rules.d $ cat 99-input.rules
SUBSYSTEM=="input", GROUP="input", MODE="0660"

There's also a "default" file:

pi at raspberrypi ~ $ cat /etc/default/gpsd
# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
START_DAEMON="true"
GPSD_OPTIONS="-n"
DEVICES="/dev/ttyACM0"
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"


And here the gpsd startup file:

pi at raspberrypi ~ $ cat /etc/init.d/gpsd
#!/bin/sh
### BEGIN INIT INFO
# Provides:          gpsd
# Required-Start:    $remote_fs $syslog $network
# Should-Start:      bluetooth dbus udev
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Start-Before:    ntp
# Short-Description: GPS (Global Positioning System) daemon
# Description:       The gpsd service daemon is able to monitor one or
#                    more GPS devices connected to a host computer, making
#                    all data on the location and movements of the sensors
#                    available to be queried on TCP port 2947.
### END INIT INFO

# Author: Bernd Zeimetz <bzed at debian.org>
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="GPS (Global Positioning System) daemon"
NAME=gpsd
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then
         GPSD_SOCKET=/var/run/gpsd.sock
fi

if [ -n "$GPSD_SOCKET" ]; then
         GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET"
fi

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
         # Return
         #   0 if daemon has been started
         #   1 if daemon was already running
         #   2 if daemon could not be started
         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec 
$DAEMON --test > /dev/null \
                 || return 1
         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec 
$DAEMON -- \
                 $GPSD_OPTIONS -P $PIDFILE $DEVICES \
                 || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
         # Return
         #   0 if daemon has been stopped
         #   1 if daemon was already stopped
         #   2 if daemon could not be stopped
         #   other if a failure occurred
         start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 
--pidfile $PIDFILE --name $NAME
         RETVAL="$?"
         [ "$RETVAL" = 2 ] && return 2
         # Many daemons don't delete their pidfiles when they exit.
         rm -f $PIDFILE
         return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
         #
         # If the daemon can reload its configuration without
         # restarting (for example, when it is sent a SIGHUP),
         # then implement that here.
         #
         start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE 
--name $NAME
         return 0
}

case "$1" in
   start)
         if [ "$START_DAEMON" = "true" ]; then
                 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" 
"$NAME"
                 do_start
                 case "$?" in
                         0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                         2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
                 esac
         else
                 [ "$VERBOSE" != no ] && \
                         log_daemon_msg "Not starting $DESC" "$NAME" && \
                         log_end_msg 0
         fi
         ;;
   stop)
         [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
         do_stop
         case "$?" in
                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
         esac
         ;;
   status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
   reload|force-reload)
         log_daemon_msg "Reloading $DESC" "$NAME"
         do_reload
         log_end_msg $?
         ;;
   restart)
         #
         # If the "reload" option is implemented then remove the
         # 'force-reload' alias
         #
         log_daemon_msg "Restarting $DESC" "$NAME"
         do_stop
         case "$?" in
           0|1)
                 do_start
                 case "$?" in
                         0) log_end_msg 0 ;;
                         1) log_end_msg 1 ;; # Old process is still running
                         *) log_end_msg 1 ;; # Failed to start
                 esac
                 ;;
           *)
                 # Failed to stop
                 log_end_msg 1
                 ;;
         esac
         ;;
   *)
         echo "Usage: $SCRIPTNAME 
{start|stop|status|restart|force-reload}" >&2
         exit 3
         ;;
esac

:


-- 
Cheers,
David
Web: http://www.satsignal.eu



More information about the questions mailing list