Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-03-23 11:25:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4ddb5256acec0f62c0302911e2730183cb1a2bbb
4ddb5256
1 parent
2e1aed54
fix bug of init.d script
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
31 行增加
和
5 行删除
README.md
trunk/auto/local_ip.sh
trunk/configure
trunk/etc/init.d/srs
README.md
查看文件 @
4ddb525
...
...
@@ -169,7 +169,7 @@ See also: [Performance Test Guide](https://github.com/winlinvip/simple-rtmp-serv
*
nginx v1.5.0: 139524 lines
<br/>
## History
*
v1.0, 2014-03-22, support make install and uninstall.
*
v1.0, 2014-03-22, support make install
/install-api
and uninstall.
*
v1.0, 2014-03-22, add ./etc/init.d/srs, refine to support make clean then make.
*
v1.0, 2014-03-21, write pid to ./objs/srs.pid.
*
v1.0, 2014-03-20, refine hls code, support pure audio HLS.
...
...
trunk/auto/local_ip.sh
0 → 100755
查看文件 @
4ddb525
ip
=
`
ifconfig 2>&1|grep
'inet addr'
|grep -v
'127.0.0.1'
|awk
'NR==1 {print $2}'
|awk -F
':'
'{print $2}'
`
if
[[
-z
$ip
]]
;
then
echo
"localhost"
else
echo
$ip
fi
...
...
trunk/configure
查看文件 @
4ddb525
...
...
@@ -158,7 +158,7 @@ END
# makefile
echo
"generate Makefile"
cat
<< END > ${SRS_MAKEFILE}
.PHONY: default _default install help clean server bandwidth librtmp librtmp-sample utest _prepare_dir
.PHONY: default _default install
install-api
help clean server bandwidth librtmp librtmp-sample utest _prepare_dir
# install prefix.
SRS_PREFIX=${SRS_PREFIX}
...
...
@@ -187,7 +187,7 @@ _default: bandwidth librtmp-sample utest
@bash objs/_srs_build_summary.sh
help:
@echo "Usage: make <help>|<clean>|<server>|<bandwidth>|<librtmp>|<librtmp-sample>|<utest>|<install>|<install-
demo
>|<uninstall>"
@echo "Usage: make <help>|<clean>|<server>|<bandwidth>|<librtmp>|<librtmp-sample>|<utest>|<install>|<install-
api
>|<uninstall>"
@echo " help display this help menu"
@echo " clean cleanup project"
@echo " server build the srs(simple rtmp server) over st(state-threads)"
...
...
@@ -196,7 +196,7 @@ help:
@echo " librtmp-sample build the srs-librtmp sample"
@echo " utest build the utest for srs"
@echo " install install srs to the prefix path"
@echo " install-
demo install srs demo
to the prefix path"
@echo " install-
api install srs api
to the prefix path"
@echo " uninstall uninstall srs from prefix path"
clean:
...
...
@@ -216,7 +216,7 @@ uninstall:
@echo "rmdir \$(SRS_PREFIX)"
@rm -rf \$(SRS_PREFIX)
install-
demo
: install
install-
api
: install
@echo "mkdir \$(SRS_PREFIX)"
@mkdir -p \$(SRS_PREFIX)
@echo "copy binary files"
...
...
@@ -233,6 +233,12 @@ install-demo: install
@mkdir -p \$(SRS_PREFIX)/etc/init.d
@cp etc/init.d/srs-api \$(SRS_PREFIX)/etc/init.d
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(SRS_PREFIX)/etc/init.d/srs-api
@echo ""
@echo "api installed, to link and start api:"
@echo " sudo ln -sf /usr/local/srs/etc/init.d/srs-api /etc/init.d/srs-api"
@echo " /etc/init.d/srs-api start"
@echo " http://$(shell bash auto/local_ip.sh):8085"
@echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService"
install:
@echo "mkdir \$(SRS_PREFIX)"
...
...
@@ -247,6 +253,11 @@ install:
@mkdir -p \$(SRS_PREFIX)/etc/init.d
@cp etc/init.d/srs \$(SRS_PREFIX)/etc/init.d
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(SRS_PREFIX)/etc/init.d/srs
@echo ""
@echo "srs installed, to link and start srs:"
@echo " sudo ln -sf /usr/local/srs/etc/init.d/srs /etc/init.d/srs"
@echo " /etc/init.d/srs start"
@echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService"
END
...
...
trunk/etc/init.d/srs
查看文件 @
4ddb525
...
...
@@ -71,6 +71,15 @@ start() {
(
cd
${
ROOT
}
; nohup
${
APP
}
-c
${
CONFIG
}
>/dev/null 2>&1 &
)
# check again after start server
sleep 0.5
for
((
i
=
0; i < 5; i++
))
;
do
# sleep a little while, for srs may start then crash.
sleep 0.1
load_process_info
ret
=
$?
;
if
[[
0 -ne
$ret
]]
;
then
failed_msg
"SRS start failed"
;
return
$ret
;
fi
done
# check whether started.
load_process_info
ret
=
$?
;
if
[[
0 -eq
$?
]]
;
then
ok_msg
"SRS started(pid
${
srs_pid
}
)"
;
return
0;
fi
...
...
请
注册
或
登录
后发表评论