| #!/sbin/runscript |
| # Copyright 1999-2004 Gentoo Foundation |
| # Distributed under the terms of the GNU General Public License v2 |
| # $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpsd/files/gpsd.init,v 1.7 2009/08/23 00:01:40 nerdboy Exp $ |
| |
| # You can use this init script to manage a serial port GPS or other |
| # non-hotplug device (or any device for that matter). By design, |
| # USB devices should use the hotplug script instead. |
| |
| depend() { |
| after serial hotplug dbus bluetooth |
| before ntpd |
| } |
| |
| checkconfig() { |
| if [ -z "${GPS_DEV}" ]; then |
| eerror "You must define GPS_DEV in /etc/conf.d/gpsd." |
| return 1 |
| fi |
| } |
| |
| start() { |
| checkconfig || return 1 |
| ebegin "Starting gpsd" |
| start-stop-daemon --start --quiet --exec /usr/sbin/gpsd \ |
| -- ${GPSD_OPTS} ${GPS_DEV} |
| eend $? "Failed to start gpsd" |
| } |
| |
| stop() { |
| ebegin "Stopping gpsd" |
| start-stop-daemon --stop --quiet --pidfile /var/run/gpsd.pid |
| eend $? "Failed to stop gpsd" |
| rm -f /var/run/gpsd.pid |
| } |