]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart/stop: use pkill instead of killall
authorLoic Dachary <loic@dachary.org>
Mon, 16 Dec 2013 15:27:34 +0000 (16:27 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 17 Dec 2013 12:48:18 +0000 (13:48 +0100)
killall fails to kill all OSDs when called as a oneliner. Replace with a
loop using pkill that retries until there are no more process to kill by
the required name.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/stop.sh

index 3a3ed16e6792623fcf8df73d27768c28b95ccafb..4891336502bc98cf201c3c589ca087cb603161c5 100755 (executable)
@@ -1,4 +1,20 @@
-#!/bin/sh
+#!/bin/bash -x
+#
+# Copyright (C) 2013 Inktank <info@inktank.com>
+# Copyright (C) 2013 Cloudwatt <libre.licensing@cloudwatt.com>
+#
+# Author: Loic Dachary <loic@dachary.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Library Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library Public License for more details.
+#
 
 test -d dev/osd0/. && test -e dev/sudo && SUDO="sudo"
 
@@ -41,7 +57,9 @@ while [ $# -ge 1 ]; do
 done
 
 if [ $stop_all -eq 1 ]; then
-       killall ceph-mon ceph-mds ceph-osd radosgw lt-radosgw apache2
+       for p in ceph-mon ceph-mds ceph-osd radosgw lt-radosgw apache2 ; do
+            while pkill $p ; do : ; done
+        done
        pkill -f valgrind.bin.\*ceph-mon
        $SUDO pkill -f valgrind.bin.\*ceph-osd
        pkill -f valgrind.bin.\*ceph-mds