aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
authorwen <wen@FreeBSD.org>2010-05-28 08:52:25 +0800
committerwen <wen@FreeBSD.org>2010-05-28 08:52:25 +0800
commit1cf7e883660e6389c306f8828495a32ad830d0b3 (patch)
tree425d657837a7121e10fe83fc1efe027a7db475bb /astro
parent89f45dc76ad91889d2171c381052f00813c861ee (diff)
downloadfreebsd-ports-gnome-1cf7e883660e6389c306f8828495a32ad830d0b3.tar.gz
freebsd-ports-gnome-1cf7e883660e6389c306f8828495a32ad830d0b3.tar.zst
freebsd-ports-gnome-1cf7e883660e6389c306f8828495a32ad830d0b3.zip
- Improve rc scipts
Submitted by: glebius@freebsd.org (via email)
Diffstat (limited to 'astro')
-rw-r--r--astro/gpsd/Makefile1
-rw-r--r--astro/gpsd/files/gpsd.in33
2 files changed, 34 insertions, 0 deletions
diff --git a/astro/gpsd/Makefile b/astro/gpsd/Makefile
index 75444e828082..5b1a695ac4d4 100644
--- a/astro/gpsd/Makefile
+++ b/astro/gpsd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= gpsd
PORTVERSION= 2.94
+PORTREVISION= 1
CATEGORIES= astro geography
MASTER_SITES= ${MASTER_SITE_BERLIOS}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/astro/gpsd/files/gpsd.in b/astro/gpsd/files/gpsd.in
index 71a0d0738166..afc7f7563047 100644
--- a/astro/gpsd/files/gpsd.in
+++ b/astro/gpsd/files/gpsd.in
@@ -26,15 +26,48 @@
name=gpsd
rcvar=`set_rcvar`
+start_postcmd=start_postcmd
+stop_postcmd=stop_postcmd
+
+start_postcmd()
+{
+ if ! checkyesno gpxlogger_enable; then
+ return;
+ fi
+
+ cd ${gpxlogger_logdir};
+ gpx=$(date +"${gpxlogger_format}")
+ touch "${pidfile_logger}" "${gpx}"
+ chown nobody:nobody "${pidfile_logger}" "${gpx}"
+ /usr/sbin/daemon -u nobody -p "${pidfile_logger}" \
+ ${gpxlogger} ${gpxlogger_flags} > ${gpx}
+}
+
+stop_postcmd()
+{
+ if ! checkyesno gpxlogger_enable; then
+ return;
+ fi
+
+ /bin/kill $(/bin/cat "${pidfile_logger}")
+}
+
load_rc_config $name
# Set defaults
: ${gpsd_enable:="NO"}
: ${gpsd_flags:=""}
: ${gpsd_devices:=""}
+: ${gpxlogger_enable:="NO"}
+: ${gpxlogger_flags:="-i 600"}
+: ${gpxlogger_logdir:="/var/log"}
+: ${gpxlogger_format:="%d %B %Y - %H:%M.gpx"}
pidfile=/var/run/$name.pid
command=%%PREFIX%%/sbin/$name
command_args="-P $pidfile $gpsd_devices"
+gpxlogger=/usr/local/bin/gpxlogger
+pidfile_logger=/var/run/gpxlogger.pid
+
run_rc_command "$1"