ctrl-c sends SIGINT signal, and the SIGINT will be delivered to the
process tree, but it does not work on non-job-controlled (usually in
script) child process.
SIGTERM works on child process, but it does not spread offspring
processes, so we send it to all lustre mount processes.
excerpt from bash manpage:
set [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]
set [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]
-m Monitor mode. Job control is enabled. This option is on by
default for interactive shells on systems that support it.
Non-builtin commands run by bash have signal handlers set to the
values inherited by the shell from its parent. When job control is
not in effect, asynchronous commands ignore SIGINT and SIGQUIT in
addition to these inherited handlers.
Change-Id: I099fe53373470ad2182f7bd20ff88cb896b1f955
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1049
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
ps --ppid $MOUNT_PID
ps --ppid $MOUNT_LUSTRE_PID
- # FIXME why o why can't I kill these? Manual "ctrl-c" works...
- kill -TERM $MOUNT_LUSTRE_PID
echo "waiting for mount to finish"
ps -ef | grep mount
+ # "ctrl-c" sends SIGINT but it usually (in script) does not work on child process
+ # SIGTERM works but it does not spread to offspring processses
+ kill -s SIGTERM $MOUNT_PID
+ kill -s SIGTERM $MOUNT_LUSTRE_PID
# we can not wait $MOUNT_PID because it is not a child of this shell
local PID1
local PID2