Merge pull request #29538 from taosdata/fix/main/TD-33489

fix: use ps -C to find process pid
This commit is contained in:
WANG Xu 2025-01-09 15:20:48 +08:00 committed by GitHub
commit cc6b4beb5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ fi
kill_service_of() {
_service=$1
pid=$(ps -ef | grep $_service | grep -v grep | grep -v $uninstallScript | awk '{print $2}')
pid=$(ps -C $_service | grep -v $uninstallScript | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi

View File

@ -40,7 +40,7 @@ if command -v sudo > /dev/null; then
fi
function kill_client() {
pid=$(ps -ef | grep ${clientName2} | grep -v grep | grep -v $uninstallScript2 | awk '{print $2}')
pid=$(ps -C ${clientName2} | grep -v $uninstallScript2 | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi