File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 19
19
20
20
pidFilePath=$appdir /$PIDFILE
21
21
22
- if [ ! -f " $pidFilePath " ] || ! kill -0 " $( cat " $pidFilePath " ) " ; then
23
- echo ' Job server not running'
22
+ if [ ! -f " $pidFilePath " ]; then
23
+ echo ' Job server not running'
24
24
else
25
- echo ' Stopping job server...'
26
25
PID=" $( cat " $pidFilePath " ) "
27
- " $( dirname " $0 " ) " /kill-process-tree.sh 15 $PID && rm " $pidFilePath "
28
- echo ' ...job server stopped'
26
+ if ! kill -0 $PID ; then
27
+ echo " PID file exists but the process $PID does not exist. Removing $pidFilePath "
28
+ rm " $pidFilePath "
29
+ else
30
+ echo ' Stopping job server...'
31
+ " $( dirname " $0 " ) " /kill-process-tree.sh 15 $PID
32
+ if ! kill -0 $PID 2> /dev/null ; then
33
+ echo ' ...job server stopped'
34
+ rm " $pidFilePath "
35
+ else
36
+ echo ' ...?? job server is still running'
37
+ fi
38
+ fi
29
39
fi
30
40
31
-
32
-
You can’t perform that action at this time.
0 commit comments