gluon/patches/packages/routing/0004-oonf-olsrd2-add-support-to-check-if-service-is-running.patch

21 lines
646 B
Diff
Raw Permalink Normal View History

2022-12-30 09:22:50 +00:00
From: Maciej Krüger <mkg20001@gmail.com>
Date: Sun, 10 Apr 2022 01:58:41 +0200
Subject: oonf-olsrd2: add support to check if service is running
diff --git a/oonf-olsrd2/files/olsrd2.init b/oonf-olsrd2/files/olsrd2.init
index debae9883258b821a5ea0aecebe879ddc84e29eb..b6c1e9a5522788005db850ceaf6699aa1eee6877 100755
--- a/oonf-olsrd2/files/olsrd2.init
+++ b/oonf-olsrd2/files/olsrd2.init
@@ -3,4 +3,11 @@
START=82
DAEMON='olsrd2'
+running() {
+ test -e "/tmp/run/olsrd2.pid" && test -e "/proc/$(cat "/tmp/run/olsrd2.pid")" && return 0
+ return 1
+}
+
+extra_command "running" "Check if service is running"
+
. /lib/functions/oonf_init.sh