mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
travelmate: bugfix 1.3.7
* fix a possible 'reload' race condition Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -31,14 +31,14 @@ start_service()
|
||||
|
||||
reload_service()
|
||||
{
|
||||
local ppid pid
|
||||
local ppid pid timeout="$(uci_get travelmate global trm_timeout)"
|
||||
|
||||
if [ -s "${trm_pidfile}" ]
|
||||
then
|
||||
ppid="$(cat "${trm_pidfile}" 2>/dev/null)"
|
||||
if [ -n "${ppid}" ]
|
||||
then
|
||||
pid="$(pgrep sleep -P ${ppid} 2>/dev/null)"
|
||||
pid="$(pgrep -xnf "sleep ${timeout:-60} 0" -P ${ppid} 2>/dev/null)"
|
||||
if [ -n "${pid}" ]
|
||||
then
|
||||
kill -INT ${pid} 2>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user