|
YishanshanJun 22, 2017
2
@l9rw 求网址
|
|
0asisJun 22, 2017 via iPhone
4
有个叫 init.d 的文件夹,具体百度
|
|
6
@0asis 怎么让“ ffmpeg -i rtsp://admin:******@192.168.16.233/h264/ch1/main/av_stream -vcodec copy -acodec aac -ar 44100 -strict -2 -ac 1 -f flv -s 1280x720 -q 10 -f flv rtmp://192.168.16.112:1935/live/hall_2 >/dev/null 2>&1 &
”这条命令加到开机自动运行 |
|
knightdfJun 22, 2017
8
加到 /etc/rc.local
|
|
theconJun 22, 2017
10
早期版本很简单 , 把脚本放 /etc/rc.local 里就行了
16.04 以后就比较麻烦了, 得自己添加个 systemctl 服务 |
|
12
@gzwawj
vi /etc/systemd/system/尼想要的服务名.service 加入如下内容: [Unit] Description=尼的脚本路径 Compatibility ConditionPathExists=尼的脚本路径 [Service] Type=forking ExecStart=尼的脚本路径 start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target 脚本要有可执行属性, 路径要绝对路径 然后取保脚本正确执行后最后的代码是: exit 0 激活服务: sudo systemctl enable 尼想要的服务名 启动服务器和检查状态: sudo systemctl start 尼想要的服务名.service sudo systemctl status 尼想要的服务名.service |
|
ahuJun 22, 2017
16
一楼这个简直了,,,,😂
|
|
ahuJun 22, 2017
17
|
|
zjpJun 22, 2017 via Android
18
阮一峰的博客有 systemd 的介绍。顺带吐个槽:doge: 就在刚刚,systemctl enable xxx 一直不成功,排查半小时发现脚本打漏仨字母…
|
|
b1eberg0nJun 23, 2017 via iPhone
20
supervisor
|
|
loadingJun 23, 2017 via Android
21
ubuntu wiki 挂了?
|