Lines 52-65
crowdsec_stop_precmd() {
Link Here
|
52 |
if [ -r "$pidfile_crowdsec" ]; then |
52 |
if [ -r "$pidfile_crowdsec" ]; then |
53 |
_CROWDSECPID="$(check_pidfile "$pidfile_crowdsec" "$command_crowdsec")" |
53 |
_CROWDSECPID="$(check_pidfile "$pidfile_crowdsec" "$command_crowdsec")" |
54 |
export _CROWDSECPID |
54 |
export _CROWDSECPID |
|
|
55 |
# notification plugins |
56 |
_CROWDSEC_CHILDREN="$(pgrep -P "$_CROWDSECPID")" |
57 |
export _CROWDSEC_CHILDREN |
55 |
fi |
58 |
fi |
56 |
} |
59 |
} |
57 |
|
60 |
|
58 |
crowdsec_stop_postcmd() { |
61 |
crowdsec_stop_postcmd() { |
|
|
62 |
# don't trust sbin/daemon to send the signal |
63 |
kill -TERM "$_CROWDSECPID" 2>/dev/null |
59 |
# wait for process to exit before restarting, or it will find the http port in use |
64 |
# wait for process to exit before restarting, or it will find the http port in use |
60 |
if [ -n "$_CROWDSECPID" ]; then |
65 |
if [ -n "$_CROWDSECPID" ]; then |
61 |
wait_for_pids "$_CROWDSECPID" |
66 |
wait_for_pids "$_CROWDSECPID" |
62 |
fi |
67 |
fi |
|
|
68 |
if [ -n "$_CROWDSEC_CHILDREN" ]; then |
69 |
kill -TERM $_CROWDSEC_CHILDREN 2>/dev/null |
70 |
wait_for_pids $_CROWDSEC_CHILDREN |
71 |
fi |
63 |
} |
72 |
} |
64 |
|
73 |
|
65 |
crowdsec_precmd() { |
74 |
crowdsec_precmd() { |
66 |
- |
|
|