Properly handle the socket redirections
This commit is contained in:
parent
85694429ee
commit
6164d713df
7
rowbot
7
rowbot
|
@ -297,7 +297,7 @@ on_sys_first_002_net() {
|
||||||
|
|
||||||
socat "$conn_args" - <"$sock_dir"/rowbot-in.sock >"$sock_dir"/rowbot-out.sock &
|
socat "$conn_args" - <"$sock_dir"/rowbot-in.sock >"$sock_dir"/rowbot-out.sock &
|
||||||
tls_pid=$!
|
tls_pid=$!
|
||||||
exec {out_sock}>"$sock_dir"/rowbot-out.sock {in_sock}<"$sock_dir"/rowbot-in.sock
|
exec {out_sock}>"$sock_dir"/rowbot-in.sock {in_sock}<"$sock_dir"/rowbot-out.sock
|
||||||
log_debug "process %d is handling tls" "$tls_pid"
|
log_debug "process %d is handling tls" "$tls_pid"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -308,6 +308,11 @@ on_sys_exit_998_net() {
|
||||||
exec {irc_sock}>&-
|
exec {irc_sock}>&-
|
||||||
else
|
else
|
||||||
log_info "rowbot is closing the connection to ircs://%s:%s" "${config[server]}" "${config[port]}"
|
log_info "rowbot is closing the connection to ircs://%s:%s" "${config[server]}" "${config[port]}"
|
||||||
|
|
||||||
|
if [[ -v tls_pid ]]; then
|
||||||
|
kill -INT "$tls_pid"
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf -- "$sock_dir"
|
rm -rf -- "$sock_dir"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue