start/stop gen_gdl90 directly fron init.d-stratux

pull/196/head
bradanlane 2016-01-08 16:02:57 -05:00
rodzic 3c7d700cff
commit 4d85491f67
4 zmienionych plików z 10 dodań i 8 usunięć

1
.gitignore vendored
Wyświetl plik

@ -3,6 +3,7 @@ dump978/uat2esnt
dump978/uat2json
dump978/uat2text
gen_gdl90
libdump978.so
*.mp4

Wyświetl plik

@ -66,11 +66,7 @@ www:
install:
cp -f gen_gdl90 /usr/bin/gen_gdl90
chmod 755 /usr/bin/gen_gdl90
cp start_uat.sh /usr/bin/start_uat
cp init.d-stratux /etc/init.d/stratux
cp start_stratux.sh /usr/sbin/stratux
chmod 755 /usr/bin/start_uat
chmod 755 /usr/sbin/stratux
chmod 755 /etc/init.d/stratux
ln -sf /etc/init.d/stratux /etc/rc2.d/S01stratux
ln -sf /etc/init.d/stratux /etc/rc6.d/K01stratux

Wyświetl plik

@ -13,7 +13,7 @@
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SBIN=/usr/sbin/stratux
DAEMON_SBIN=/usr/bin/gen_gdl90
DAEMON_DEFS=
DAEMON_CONF=
NAME=stratux
@ -22,14 +22,14 @@ PIDFILE=/var/run/stratux.pid
[ -x "$DAEMON_SBIN" ] || exit 0
DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF"
DAEMON_OPTS=""
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_SBIN" \
start-stop-daemon --start --background --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE" --make-pidfile -- $DAEMON_OPTS >/dev/null
log_end_msg "$?"
;;
@ -37,6 +37,7 @@ case "$1" in
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE"
pkill dump1090 || true
log_end_msg "$?"
;;
reload)

Wyświetl plik

@ -1196,6 +1196,7 @@ func main() {
develFlag := flag.Bool("developer", false, "Developer mode")
replayFlag := flag.Bool("replay", false, "Replay file flag")
replaySpeed := flag.Int("speed", 1, "Replay speed multiplier")
stdinFlag := flag.Bool("uatin", false, "Process UAT messages piped to stdin")
flag.Parse()
@ -1312,7 +1313,7 @@ func main() {
}
}
} else {
} else if *stdinFlag == true {
for {
buf, err := reader.ReadString('\n')
if err != nil {
@ -1324,5 +1325,8 @@ func main() {
relayMessage(msgtype, o)
}
}
} else {
// wait indefinitely
select {}
}
}