3 # gpsd This shell script starts and stops gpsd.
6 # description: Gpsd manages access to a serial- or USB-connected GPS
9 # If you must specify a non-NMEA driver, uncomment and modify the next line
13 # Source function library.
14 #. /etc/rc.d/init.d/functions
21 echo -n "Starting $prog: "
22 # We don't use the daemon function here because of a known bug
23 # in initlog -- it spuriously returns a nonzero status when
24 # starting daemons that fork themselves. See
25 # http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130629
26 # for discussion. Fortunately:
28 # 1. gpsd startup can't fail, or at least not in the absence of
29 # much larger resource-exhaustion problems that would be very obvious.
31 # 2. We don't need all the logging crud that daemon/initlog sets
32 # up -- gpsd does its own syslog calls.
34 if [ -e "${GPS_DEV}" ]
36 gpsd ${GPSD_OPTS} -p ${GPS_DEV}
39 # User needs to symlink ${GPS_DEV} to the right thing
40 echo "No ${GPS_DEV} device, aborting gpsd startup."
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpsd
50 echo -n "Shutting down $prog: "
57 rm -f /var/lock/subsys/gpsd;
62 # See how we were called.
76 if [ -f /var/lock/subsys/gpsd ]; then
87 echo "Usage: $0 {start|stop|restart|condrestart|status}"