]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/bin/sh |
2 | ||
3 | sleep=5 | |
1e59de90 TL |
4 | no_restart=0 |
5 | ||
6 | if [ $1 == "--no-restart" ]; then | |
7 | no_restart=1 | |
8 | shift | |
9 | fi | |
7c673cae FG |
10 | |
11 | while [ true ]; do | |
12 | "$@" | |
13 | exit_code=$? | |
14 | ||
1e59de90 | 15 | if [ $exit_code -gt 128 ] && [ $no_restart -eq 0 ]; then |
7c673cae FG |
16 | case $(($exit_code-128)) in |
17 | 3 | 4 | 5 | 6 | 8 | 11) | |
18 | ;; | |
19 | *) | |
20 | exit; | |
21 | esac | |
22 | echo ceph-run: $1 dumped core, restarting in $sleep seconds... | |
23 | sleep $sleep | |
24 | else | |
25 | exit | |
26 | fi | |
27 | done |