That'll do the trick :-) but there isn't much in the way of detection and remediation in that code, which is what I thought you were aiming for. If you want a rock-solid solution you should probably use a non-blocking socket/pipe and then restarts gpsd if it goes too long without reporting anything. Maybe also add a software-controlled electrical disconnect on the USB port so that you can power-cycle the device :-)