mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1579, support gracefully quit. 3.0.119
This commit is contained in:
parent
e6c329293c
commit
3c597545b1
10 changed files with 120 additions and 17 deletions
|
@ -178,6 +178,18 @@ logrotate() {
|
|||
return 0
|
||||
}
|
||||
|
||||
grace() {
|
||||
# not start, exit
|
||||
load_process_info
|
||||
if [[ 0 -ne $? ]]; then failed_msg "SRS not start."; return 0; fi
|
||||
|
||||
ok_msg "Gracefully quit for SRS(pid ${srs_pid})..."
|
||||
kill -s SIGQUIT ${srs_pid}
|
||||
|
||||
ok_msg "Gracefully quit"
|
||||
return 0
|
||||
}
|
||||
|
||||
menu() {
|
||||
case "$1" in
|
||||
start)
|
||||
|
@ -199,10 +211,14 @@ menu() {
|
|||
rotate)
|
||||
logrotate
|
||||
;;
|
||||
grace)
|
||||
grace
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|restart|reload|rotate}"
|
||||
echo "Usage: $0 {start|stop|status|restart|reload|rotate|grace}"
|
||||
echo " reload Apply log file by not restarting SRS"
|
||||
echo " rotate For log rotate, to send SIGUSR1 to SRS to reopen the log file."
|
||||
echo " grace For gracefully quit, to send SIGQUIT to SRS."
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue