#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ #NB: Config is in /etc/conf.d/gpsd depend() { need localmount use hotplug logger } check_config() { if ! [ -c "${GPSD_PATH}" ]; then eerror "Please make sure that GPSD_PATH is set up correctly." return 1; fi } start() { check_config || return 1 ebegin "Starting gpsd" # If we don't set -D 2 here gpsd itself will fork and we wont # have the right pid. start-stop-daemon --start --quiet --pidfile /var/run/gpsd.pid \ --make-pidfile --background --exec /usr/bin/gpsd -- -p \ ${GPSD_PATH} ${GPSD_OPTS} -D 2 eend ${?} } stop() { ebegin "Stopping gpsd" start-stop-daemon --stop --quiet --pidfile /var/run/gpsd.pid eend ${?} }