[Maria-developers] Rev 4: Added wrapper scripts for automated runs of sql-bench. in file:///Users/hakan/work/monty_program/mariadb-tools/
![](https://secure.gravatar.com/avatar/f07edef711f62df1b869b658b12d4623.jpg?s=120&d=mm&r=g)
At file:///Users/hakan/work/monty_program/mariadb-tools/
------------------------------------------------------------
revno: 4
revision-id: hakan@askmonty.org-20091229134253-zdbgd0ym9m7cokii
parent: knielsen@knielsen-hq.org-20091218103524-nof6wfpuku60r9rn
committer: Hakan Kuecuekyilmaz
![](https://secure.gravatar.com/avatar/533a635acbbf207d37bd37420d40c019.jpg?s=120&d=mm&r=g)
Hi, Hakan! On Dec 29, Hakan Kuecuekyilmaz wrote:
At file:///Users/hakan/work/monty_program/mariadb-tools/
------------------------------------------------------------ revno: 4 revision-id: hakan@askmonty.org-20091229134253-zdbgd0ym9m7cokii parent: knielsen@knielsen-hq.org-20091218103524-nof6wfpuku60r9rn committer: Hakan Kuecuekyilmaz
branch nick: mariadb-tools timestamp: Tue 2009-12-29 14:42:53 +0100 message: Added wrapper scripts for automated runs of sql-bench.
=== added directory 'sql-bench' === added file 'sql-bench/run-sql-bench.sh' --- a/sql-bench/run-sql-bench.sh 1970-01-01 00:00:00 +0000 +++ b/sql-bench/run-sql-bench.sh 2009-12-29 13:42:53 +0000 @@ -0,0 +1,236 @@ +#!/bin/bash +# +# Run sql-bench for every given configuration file +# we find in the directory $SQL_BENCH_CONFIGS. +# +# Note: Do not run this script with root privileges. +# We use killall -9, which can cause severe side effects!
You can use
killall -u `whoami`
not perfect, but still much safer.
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik
![](https://secure.gravatar.com/avatar/f07edef711f62df1b869b658b12d4623.jpg?s=120&d=mm&r=g)
Am 29.12.2009 um 15:09 schrieb Sergei Golubchik
Hi, Hakan!
On Dec 29, Hakan Kuecuekyilmaz wrote:
At file:///Users/hakan/work/monty_program/mariadb-tools/
------------------------------------------------------------ revno: 4 revision-id: hakan@askmonty.org-20091229134253-zdbgd0ym9m7cokii parent: knielsen@knielsen-hq.org-20091218103524-nof6wfpuku60r9rn committer: Hakan Kuecuekyilmaz
branch nick: mariadb-tools timestamp: Tue 2009-12-29 14:42:53 +0100 message: Added wrapper scripts for automated runs of sql-bench. === added directory 'sql-bench' === added file 'sql-bench/run-sql-bench.sh' --- a/sql-bench/run-sql-bench.sh 1970-01-01 00:00:00 +0000 +++ b/sql-bench/run-sql-bench.sh 2009-12-29 13:42:53 +0000 @@ -0,0 +1,236 @@ +#!/bin/bash +# +# Run sql-bench for every given configuration file +# we find in the directory $SQL_BENCH_CONFIGS. +# +# Note: Do not run this script with root privileges. +# We use killall -9, which can cause severe side effects!
You can use
killall -u `whoami`
not perfect, but still much safer.
I think that's not much safer. If run by root, then whoami will return root. I will add a simple check whether the script was started by root and if so, simply abort. Thanks for noting out this one, Hakan
![](https://secure.gravatar.com/avatar/99fde0c1dfd216326aae0aff30d493f1.jpg?s=120&d=mm&r=g)
Sergei Golubchik
On Dec 29, Hakan Kuecuekyilmaz wrote:
+# Note: Do not run this script with root privileges. +# We use killall -9, which can cause severe side effects!
You can use
killall -u `whoami`
not perfect, but still much safer.
There is another, robust way to do this: Make the parent process a group leader with setpgid(0,0). Then `kill -9 -$$` will kill only the processes started from that parent (or from children, recursively). Or use setsid to create a session leader for even more robust killing (there is a setsid command available to do this within shell scripts). (You might not need this for your purpose, but I thought I would mention it in case you at some point may want to run this in Buildbot or similar). - Kristian.
participants (3)
-
Hakan Kuecuekyilmaz
-
Kristian Nielsen
-
Sergei Golubchik