Skip to content

Commit

Permalink
fix: incorrect manner of terminating the process (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
machinly authored Jun 7, 2023
1 parent ca44785 commit 27c858c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pstd/src/rsync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int StopRsync(const std::string& raw_path) {
return 0;
}

std::string rsync_stop_cmd = "kill $(ps -o pgid=" + std::to_string(pid) + ")";
std::string rsync_stop_cmd = "kill -- -$(ps -o pgid -p" + std::to_string(pid) + " | grep -o '[0-9]*')";
int ret = system(rsync_stop_cmd.c_str());
if (ret == 0 || (WIFEXITED(ret) && !WEXITSTATUS(ret))) {
LOG(INFO) << "Stop rsync success!";
Expand Down

0 comments on commit 27c858c

Please sign in to comment.