3 # gpsd Service daemon for mediating access to a GPS
6 # description: gpsd is a service daemon that mediates access to a GPS sensor \
7 # connected to the host computer by serial or USB interface, \
8 # making its data on the location/course/velocity of the sensor \
9 # available to be queried on TCP port 2947 of the host computer.
11 # pidfile: /var/run/gpsd.pid
13 # http://fedoraproject.org/wiki/FCNewInit/Initscripts
16 # Required-Start: network
17 # Required-Stop: network
22 # Short-Description: Service daemon for mediating access to a GPS
23 # Description: gpsd is a service daemon that mediates access to a GPS sensor
24 # connected to the host computer by serial or USB interface, making its
25 # data on the location/course/velocity of the sensor available to be
26 # queried on TCP port 2947 of the host computer.
29 # Source function library.
30 . /etc/rc.d/init.d/functions
33 prog=$(basename $exec)
34 PIDFILE=/var/run/gpsd.pid
35 CONTROL_SOCKET=/var/run/gpsd.sock
37 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
39 : ${DEVICE:=/dev/ttyUSB0}
41 lockfile=/var/lock/subsys/$prog
44 [ "$EUID" != "0" ] && exit 4
45 echo -n $"Starting $prog: "
46 daemon $exec -P $PIDFILE -F $CONTROL_SOCKET $OPTIONS $DEVICE
49 [ $retval -eq 0 ] && touch $lockfile
54 [ "$EUID" != "0" ] && exit 4
55 echo -n $"Stopping $prog: "
59 [ $retval -eq 0 ] && rm -f $lockfile
78 try-restart|condrestart)
79 if status $prog >/dev/null ; then
84 status $prog >/dev/null || exit 7
85 # If config can be reloaded without restarting, implement it here,
86 # remove the "exit", and add "reload" to the usage message below.
87 action $"Service $prog does not support the reload action: " /bin/false
91 echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"