mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
Support log rotate by init.d command. 3.0.60
This commit is contained in:
parent
e045b0a619
commit
8ca7f7e5a4
3 changed files with 20 additions and 2 deletions
|
@ -151,6 +151,7 @@ Please select according to languages:
|
|||
|
||||
### V3 changes
|
||||
|
||||
* v3.0, 2019-10-06, Support log rotate by init.d command. 3.0.60
|
||||
* v3.0, 2019-10-06, We prefer ipv4, only use ipv6 if ipv4 is disabled. 3.0.59
|
||||
* v3.0, 2019-10-05, Support systemctl service for CentOS7. 3.0.58
|
||||
* v3.0, 2019-10-04, Disable SO_REUSEPORT if not supported. 3.0.57
|
||||
|
|
|
@ -166,6 +166,18 @@ reload() {
|
|||
return 0
|
||||
}
|
||||
|
||||
logrotate() {
|
||||
# not start, exit
|
||||
load_process_info
|
||||
if [[ 0 -ne $? ]]; then failed_msg "SRS not start."; return 0; fi
|
||||
|
||||
ok_msg "Reopen log file of SRS(pid ${srs_pid})..."
|
||||
kill -s SIGUSR1 ${srs_pid}
|
||||
|
||||
ok_msg "Log rotated"
|
||||
return 0
|
||||
}
|
||||
|
||||
menu() {
|
||||
case "$1" in
|
||||
start)
|
||||
|
@ -184,8 +196,13 @@ menu() {
|
|||
reload)
|
||||
reload
|
||||
;;
|
||||
rotate)
|
||||
logrotate
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|restart|reload}"
|
||||
echo "Usage: $0 {start|stop|status|restart|reload|rotate}"
|
||||
echo " reload Apply log file by not restarting SRS"
|
||||
echo " rotate For log rotate, to send SIGUSR1 to SRS to reopen the log file."
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
// The version config.
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 59
|
||||
#define VERSION_REVISION 60
|
||||
|
||||
// The macros generated by configure script.
|
||||
#include <srs_auto_headers.hpp>
|
||||
|
|
Loading…
Reference in a new issue