mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Support systemctl service for CentOS7. 3.0.58
This commit is contained in:
parent
f6fc31db66
commit
64288d1f1e
5 changed files with 49 additions and 11 deletions
|
@ -151,6 +151,7 @@ Please select according to languages:
|
|||
|
||||
### V3 changes
|
||||
|
||||
* 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
|
||||
* <strong>v3.0, 2019-10-04, [3.0 alpha0(3.0.56)][r3.0a0] released. 107946 lines.</strong>
|
||||
* v3.0, 2019-10-04, Support go-oryx rtmplb with [proxy protocol](https://github.com/ossrs/go-oryx/wiki/RtmpProxy). 3.0.56
|
||||
|
|
22
trunk/configure
vendored
22
trunk/configure
vendored
|
@ -484,22 +484,30 @@ install:
|
|||
@mkdir -p \$(__REAL_INSTALL)
|
||||
@echo "Now make the http root dir"
|
||||
@mkdir -p \$(__REAL_INSTALL)/objs/nginx/html
|
||||
@cp research/api-server/static-dir/crossdomain.xml \$(__REAL_INSTALL)/objs/nginx/html
|
||||
@cp -f research/api-server/static-dir/crossdomain.xml \$(__REAL_INSTALL)/objs/nginx/html
|
||||
@echo "Now copy binary files"
|
||||
@mkdir -p \$(__REAL_INSTALL)/objs
|
||||
@cp objs/srs \$(__REAL_INSTALL)/objs
|
||||
@cp -f objs/srs \$(__REAL_INSTALL)/objs
|
||||
@echo "Now copy srs conf files"
|
||||
@mkdir -p \$(__REAL_INSTALL)/conf
|
||||
@cp conf/*.conf \$(__REAL_INSTALL)/conf
|
||||
@cp -f conf/*.conf \$(__REAL_INSTALL)/conf
|
||||
@echo "Now copy init.d script files"
|
||||
@mkdir -p \$(__REAL_INSTALL)/etc/init.d
|
||||
@cp etc/init.d/srs \$(__REAL_INSTALL)/etc/init.d
|
||||
@cp -f etc/init.d/srs \$(__REAL_INSTALL)/etc/init.d
|
||||
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs
|
||||
@echo "Now copy systemctl service files"
|
||||
@mkdir -p \$(__REAL_INSTALL)/usr/lib/systemd/system
|
||||
@cp -f usr/lib/systemd/system/srs.service \$(__REAL_INSTALL)/usr/lib/systemd/system/srs.service
|
||||
@echo ""
|
||||
@echo "SRS is installed, to link and start srs:"
|
||||
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs"
|
||||
@echo "The api installed, to link and start srs, please"
|
||||
@echo "For CentOS6:"
|
||||
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs &&"
|
||||
@echo " /etc/init.d/srs start"
|
||||
@echo "@see: https://github.com/ossrs/srs/wiki/v1_CN_LinuxService"
|
||||
@echo "For CentOS7:"
|
||||
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs &&"
|
||||
@echo " sudo cp -f \$(SRS_PREFIX)/usr/lib/systemd/system/srs.service /usr/lib/systemd/system/srs.service && sudo systemctl daemon-reload && sudo systemctl enable srs &&"
|
||||
@echo " sudo systemctl start srs"
|
||||
@echo "@see: https://github.com/ossrs/srs/wiki/v3_CN_LinuxService"
|
||||
|
||||
END
|
||||
fi
|
||||
|
|
|
@ -83,6 +83,17 @@ ok_msg "install init.d scripts"
|
|||
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "install init.d scripts failed"; exit $ret; fi
|
||||
ok_msg "install init.d scripts success"
|
||||
|
||||
# For systemctl
|
||||
if [[ -d /usr/lib/systemd/system ]]; then
|
||||
ok_msg "install srs.service for systemctl"
|
||||
(
|
||||
cp -f $install_root/usr/lib/systemd/system/srs.service /usr/lib/systemd/system/srs.service &&
|
||||
systemctl daemon-reload
|
||||
) >>$log 2>&1
|
||||
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "install srs.service for systemctl failed"; exit $ret; fi
|
||||
ok_msg "install srs.service for systemctl success"
|
||||
fi
|
||||
|
||||
# install system service
|
||||
lsb_release --id|grep "CentOS" >/dev/null 2>&1; os_id_centos=$?
|
||||
lsb_release --id|grep "Ubuntu" >/dev/null 2>&1; os_id_ubuntu=$?
|
||||
|
@ -90,7 +101,11 @@ lsb_release --id|grep "Debian" >/dev/null 2>&1; os_id_debian=$?
|
|||
lsb_release --id|grep "Raspbian" >/dev/null 2>&1; os_id_rasabian=$?
|
||||
if [[ 0 -eq $os_id_centos ]]; then
|
||||
ok_msg "install system service for CentOS"
|
||||
if [[ -d /usr/lib/systemd/system ]]; then
|
||||
systemctl enable srs
|
||||
else
|
||||
/sbin/chkconfig --add srs && /sbin/chkconfig srs on
|
||||
fi
|
||||
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "install system service failed"; exit $ret; fi
|
||||
ok_msg "install system service success"
|
||||
elif [[ 0 -eq $os_id_ubuntu ]]; then
|
||||
|
@ -113,9 +128,11 @@ else
|
|||
fi
|
||||
|
||||
echo ""
|
||||
echo "see: https://github.com/ossrs/srs/wiki/v1_CN_LinuxService"
|
||||
echo "install success, you can:"
|
||||
echo "see: https://github.com/ossrs/srs/wiki/v3_CN_LinuxService"
|
||||
echo "install success, you can start SRS on CentOS6:"
|
||||
echo -e "${GREEN} sudo /etc/init.d/srs start${BLACK}"
|
||||
echo "or CentOS7:"
|
||||
echo -e "${GREEN} sudo systemctl start srs${BLACK}"
|
||||
echo "srs root is ${INSTALL}"
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
// The version config.
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 57
|
||||
#define VERSION_REVISION 58
|
||||
|
||||
// The macros generated by configure script.
|
||||
#include <srs_auto_headers.hpp>
|
||||
|
|
12
trunk/usr/lib/systemd/system/srs.service
Normal file
12
trunk/usr/lib/systemd/system/srs.service
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Unit]
|
||||
Description=The SRS Media Stream Cluster
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/etc/init.d/srs start
|
||||
ExecReload=/etc/init.d/srs reload
|
||||
ExecStop=/etc/init.d/srs stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue