mirror of
https://github.com/EDCD/EDDN.git
synced 2026-10-22 20:42:10 +03:00
start-eddn-service: Add 'bounce' & ps only on PID
* The ps options for filtering are logical OR, not AND, and there seems to be no way to have them be ANDed instead.
This commit is contained in:
1 parent
579e185b86
commit
2ba0865d46
1 file changed
+3
-3
@@ -9,7 +9,7 @@ EXIT_CL_ARGS=3
|
||||
EXIT_SERVICE_ALREADY_RUNNING=4
|
||||
|
||||
usage() {
|
||||
echo "Usage: $(basename $0) ( live | beta | dev ) ( gateway | monitor | relay ) [ --from-source [ --background ] ]" >&2
|
||||
echo "Usage: $(basename $0) ( live | beta | dev ) ( gateway | monitor | relay | bounce ) [ --from-source [ --background ] ]" >&2
|
||||
}
|
||||
|
||||
if [ -z "${1}" ];
|
||||
@@ -79,7 +79,7 @@ then
|
||||
|
||||
if [ -f "${LOG_DIR}/${SERVICE}.pid" ];
|
||||
then
|
||||
if ps -C python -p $(cat "${LOG_DIR}/${SERVICE}.pid") > /dev/null 2>&1;
|
||||
if ps -p $(cat "${LOG_DIR}/${SERVICE}.pid") > /dev/null 2>&1;
|
||||
then
|
||||
echo "${SERVICE}: already running as PID $(cat "${LOG_DIR}/${SERVICE}.pid")" >&2
|
||||
exit ${EXIT_SERVICE_ALREADY_RUNNING}
|
||||
@@ -105,7 +105,7 @@ else
|
||||
# We need to ensure there isn't already one, via the .pid file
|
||||
if [ -f "${LOG_DIR}/${SERVICE}.pid" ];
|
||||
then
|
||||
if ps -C python -p $(cat "${LOG_DIR}/${SERVICE}.pid") > /dev/null 2>&1;
|
||||
if ps -p $(cat "${LOG_DIR}/${SERVICE}.pid") > /dev/null 2>&1;
|
||||
then
|
||||
echo "${SERVICE}: already running as PID $(cat "${LOG_DIR}/${SERVICE}.pid")" >&2
|
||||
exit ${EXIT_SERVICE_ALREADY_RUNNING}
|
||||
|
||||
Reference in new issue
Block a user