Tools: use control socket and log file from running instance.
If unitd was started with an explicit path then unitc will use that binary instead of the default PATH to obtain the default control socket and log file locations.
This commit is contained in:
@@ -134,7 +134,7 @@ if [ $REMOTE -eq 0 ]; then
|
|||||||
PARAMS=$(ps $PID | grep unitd | cut -f2- -dv | tr '[]' ' ' | cut -f3- -d ' ' | sed -e 's/ --/\n--/g')
|
PARAMS=$(ps $PID | grep unitd | cut -f2- -dv | tr '[]' ' ' | cut -f3- -d ' ' | sed -e 's/ --/\n--/g')
|
||||||
CTRL_ADDR=$(echo "$PARAMS" | grep '\--control' | cut -f2 -d' ')
|
CTRL_ADDR=$(echo "$PARAMS" | grep '\--control' | cut -f2 -d' ')
|
||||||
if [ "$CTRL_ADDR" = "" ]; then
|
if [ "$CTRL_ADDR" = "" ]; then
|
||||||
CTRL_ADDR=$(`echo "$PARAMS" | grep unitd` --help | grep -A1 '\--control' | tail -1 | cut -f2 -d\")
|
CTRL_ADDR=$($(echo "$PARAMS" | grep unitd) --help | grep -A1 '\--control' | tail -1 | cut -f2 -d\")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare for network or Unix socket addressing
|
# Prepare for network or Unix socket addressing
|
||||||
@@ -156,7 +156,7 @@ if [ $REMOTE -eq 0 ]; then
|
|||||||
#
|
#
|
||||||
ERROR_LOG=$(echo "$PARAMS" | grep '\--log' | cut -f2 -d' ')
|
ERROR_LOG=$(echo "$PARAMS" | grep '\--log' | cut -f2 -d' ')
|
||||||
if [ "$ERROR_LOG" = "" ]; then
|
if [ "$ERROR_LOG" = "" ]; then
|
||||||
ERROR_LOG=$(unitd --help | grep -A1 '\--log' | tail -1 | cut -f2 -d\")
|
ERROR_LOG=$($(echo "$PARAMS" | grep unitd) --help | grep -A1 '\--log' | tail -1 | cut -f2 -d\")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cache the discovery for this unit PID (and cleanup any old files)
|
# Cache the discovery for this unit PID (and cleanup any old files)
|
||||||
|
|||||||
Reference in New Issue
Block a user