Diagnostic: find node binary path and working directory from running process
This commit is contained in:
@@ -145,7 +145,7 @@ jobs:
|
|||||||
if: needs.detect.outputs.migrations == 'true'
|
if: needs.detect.outputs.migrations == 'true'
|
||||||
run: |
|
run: |
|
||||||
cat > /tmp/migrate-params.json << 'PARAMS'
|
cat > /tmp/migrate-params.json << 'PARAMS'
|
||||||
{"commands":["systemctl list-units --type=service --state=running 2>/dev/null | grep -iE 'node|api|docker|filament' || echo 'no matching services'","docker ps 2>/dev/null || echo 'docker not running or not installed'","ls -la /home/ubuntu/ 2>/dev/null || echo 'no /home/ubuntu'","ls -la /home/ec2-user/ 2>/dev/null || echo 'no /home/ec2-user'","ps aux | grep -i node || echo 'no node processes'","cat /etc/os-release | head -5"]}
|
{"commands":["NODE_PID=$(pgrep -f 'node server.js' | head -1) && echo Node PID: $NODE_PID && ls -la /proc/$NODE_PID/exe && ls -la /proc/$NODE_PID/cwd && cat /proc/$NODE_PID/environ | tr '\\0' '\\n' | grep -E 'PATH|HOME|NODE' || echo 'no node process found'","systemctl cat node-api 2>/dev/null || systemctl list-units --type=service | grep -i node || echo 'no node service'","ls -la /home/ec2-user/*.js /home/ec2-user/*.json 2>/dev/null || echo 'no js in ec2-user home'"]}
|
||||||
PARAMS
|
PARAMS
|
||||||
CMD_ID=$(aws ssm send-command \
|
CMD_ID=$(aws ssm send-command \
|
||||||
--region $AWS_REGION \
|
--region $AWS_REGION \
|
||||||
|
|||||||
Reference in New Issue
Block a user