Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Unified Diff: scripts/master/kill_pidfile.sh

Issue 1863083003: Revert of Send a SIGKILL to masters after 10 seconds if they don't exit from SIGTERM (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « masters/master-common-rules.mk ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/kill_pidfile.sh
diff --git a/scripts/master/kill_pidfile.sh b/scripts/master/kill_pidfile.sh
deleted file mode 100755
index 87e32738d39419aae5f73862848d758b36c06cbc..0000000000000000000000000000000000000000
--- a/scripts/master/kill_pidfile.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Sends a SIGTERM to a process whose PID is read from a pidfile. Waits 10
-# seconds for it to exit and then sends a SIGKILL.
-
-set -e
-
-pidfile="$1"
-
-if [ -z "$pidfile" ]; then
- echo "Usage: $0 pidfile"
- exit 1
-fi
-
-if [ ! -e "$pidfile" ]; then
- echo "Pidfile $pidfile does not exist"
- exit 0
-fi
-
-pid=$(cat $pidfile)
-pgid=$(ps h -o pgid= $pid | awk '{print $1}')
-
-echo "Sending SIGTERM to PGID $pgid"
-kill -TERM -$pgid
-
-# Wait 10 seconds for it to exit.
-for i in $(seq 100); do
- if ! ps -p $pid > /dev/null; then
- exit 0
- fi
- sleep 0.1
-done
-
-echo "Sending SIGKILL to PGID $pgid"
-kill -KILL -$pgid
« no previous file with comments | « masters/master-common-rules.mk ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698