summarylogtreecommitdiffstats
path: root/chrome-shutdown-hook.py
diff options
context:
space:
mode:
authorClastres Térence2016-08-31 18:29:13 +0200
committerClastres Térence2016-08-31 18:29:13 +0200
commit28dad7c7481c234bfa68b9490e182cc7988d63da (patch)
tree05b57ba5d68ff15ccca9b628cb970c22bf82a1ed /chrome-shutdown-hook.py
parent4f00935918bddf83523064463f1391343f9b95a4 (diff)
downloadaur-28dad7c7481c234bfa68b9490e182cc7988d63da.tar.gz
Fix case where no PPID is found
Diffstat (limited to 'chrome-shutdown-hook.py')
-rw-r--r--chrome-shutdown-hook.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome-shutdown-hook.py b/chrome-shutdown-hook.py
index 23f538637786..29c73b213f72 100644
--- a/chrome-shutdown-hook.py
+++ b/chrome-shutdown-hook.py
@@ -14,15 +14,16 @@ import gnome.ui
import gtk
def chrome_clean_shutdown(*args):
- subprocess.call('/usr/bin/pkill -15 -P 1 chrome', shell=True)
+ if subprocess.call('/usr/bin/pkill -15 -P 1 chrome', shell=True) == 1:
+ subprocess.call('/usr/bin/pkill -15 -o chrome', shell=True) // if no parent, kill the oldest process
return True
def chromium_clean_shutdown(*args):
- subprocess.call('/usr/bin/pkill -15 -P 1 chromium', shell=True)
+ if subprocess.call('/usr/bin/pkill -15 -P 1 chromium', shell=True) == 1:
+ subprocess.call('/usr/bin/pkill -15 -o chromium', shell=True)
return True
-
def main():
prog = gnome.init('chrome_clean_shutdown', '1.2.3')
client = gnome.ui.master_client()