diff options
author | Liam Crilly <liam.crilly@nginx.com> | 2023-04-04 11:29:53 +0100 |
---|---|---|
committer | Liam Crilly <liam.crilly@nginx.com> | 2023-04-04 11:29:53 +0100 |
commit | c54331fa3d9597ba6bc85e7b7242981f00ed25c2 (patch) | |
tree | 5038de26ef6b4250aeb5897702e82374910c7e78 | |
parent | 485205712433611ee9939a869b4f734f824a177a (diff) | |
download | unit-c54331fa3d9597ba6bc85e7b7242981f00ed25c2.tar.gz unit-c54331fa3d9597ba6bc85e7b7242981f00ed25c2.tar.bz2 |
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.
-rwxr-xr-x | tools/unitc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/unitc b/tools/unitc index 71fef314..9973e62d 100755 --- a/tools/unitc +++ b/tools/unitc @@ -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') CTRL_ADDR=$(echo "$PARAMS" | grep '\--control' | cut -f2 -d' ') 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 # 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' ') 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 # Cache the discovery for this unit PID (and cleanup any old files) |