[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] sequential startup and stale pid file
From: |
Kiiski, Janne (EXT-Espotel - FI/Oulu) |
Subject: |
[gpsd-dev] sequential startup and stale pid file |
Date: |
Fri, 13 Mar 2015 08:20:21 +0000 |
Hi,
Noticed that sequential startup of gpsd produces stale pid file.
Quick test (tested with current master,
027002aff19ea428640d6e8489f4e992d95fc13b):
$ pgrep gpsd
$ gpsd -S 12345 -P $PWD/gpsd.pid /dev/ttyS0
$ pgrep gpsd
16161
$ cat gpsd.pid
16161
$ gpsd -S 12345 -P $PWD/gpsd.pid /dev/ttyS0
$ pgrep gpsd
16161
$ cat gpsd.pid
16165
$ kill $(cat gpsd.pid)
-bash: kill: (16165) - No such process
From syslog:
Mar 13 09:41:56 jki gpsd[16165]: gpsd:ERROR: can't bind to IPv4 port
12345, Address already in use
Mar 13 09:41:56 jki gpsd[16165]: gpsd:ERROR: maybe gpsd is already running!
Mar 13 09:41:56 jki gpsd[16165]: gpsd:ERROR: can't bind to IPv6 port
12345, Address already in use
Mar 13 09:41:56 jki gpsd[16165]: gpsd:ERROR: maybe gpsd is already running!
Second process overwrites pid file -> fails to bind sockets -> exits ==
stale pid file.
So the pid file is (over)written too early (could/should be after
successfull initialization, just before mainloop).
- janne kiiski
- [gpsd-dev] sequential startup and stale pid file,
Kiiski, Janne (EXT-Espotel - FI/Oulu) <=