summaryrefslogtreecommitdiff
path: root/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh')
-rwxr-xr-xrecipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh b/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh
index 6c9c126..a1b59cf 100755
--- a/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh
+++ b/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh
@@ -59,7 +59,10 @@ fi
ps -fjp $ppid | LG -p user.error
fi
- gpsmonpid=$(pgrep -lg $pgid | egrep '[[:space:]]gpsmon$' | sed 's/[[:space:]].*//')
+ # pgrep does not work during boot.
+ pgrpmemb=$(ps --no-heading -o pgid,pid,comm -e | grep '^ *'"${pgid}"' *' | sed -r 's/^ *[0-9]+ *//')
+ gpsmonpid=$(echo "${pgrpmemb}" | egrep '[[:space:]]gpsmon$' | sed 's/[[:space:]].*//')
+
((DEBUG)) && LG -p user.info "$pgid is pgid $gpsmonpid is gpsmonpid"
# Find the gpsmonpid that is our grandchild
((didkill=0))