【吭】Failed to parse PID from file /run/nginx.pid: Invalid argument

这篇博客详细介绍了如何处理Nginx启动时遇到的'Failed to parse PID from file/run/nginx.pid: Invalid argument'错误,涉及检查PID文件、执行sleep操作及系统服务配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

root@VM-20-12-ubuntu:/srs/trunk# cat conf/srt2.conf # 基础配置 (SRS 6.0.134) listen 19935; # RTMP 监听端口 max_connections 1000; daemon off; srs_log_tank console; srs_log_level info; # HTTP 管理接口 http_api { enabled on; listen 1985; crossdomain on; } # HTTP 服务器 http_server { enabled on; listen 8080; dir ./objs/nginx/html; } # SRT 服务器配置 srt_server { enabled on; listen 6666; connect_timeout 4000; maxbw 1000000000; latency 200; tlpktdrop on; mss 1316; # 最大分段大小 # 新增流映射配置 stream { input rtmp://127.0.0.1:19935/$ app/$ stream; output srt://:6666?streamid=#!::r=$ app/$ stream,m=request; } } # 默认虚拟主机 vhost __defaultVhost__ { # RTMP 配置直接放在 vhost 根级别 chunk_size 4096; # 发布者配置放在 publish 块中 publish { firstpkt_timeout 15000; normal_timeout 15000; } # SRT 输出配置 (简化) srt { enabled on; } # HTTP-FLV 监控 http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } } root@VM-20-12-ubuntu:/srs/trunk# ./objs/srs -c conf/srt2.conf [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] XCORE-SRS/6.0.134(Hang) [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] config parse complete [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] write log to console [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] SRS/6.0.134(Hang), MIT [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] authors: Winlin<winlinvip@gmail.com> XiaoZhihong<hondaxiao@tencent.com> Winlin<winlinvip@gmail.com> ZhaoWenjie<zhaowenjie@tal.com> ShiWei<xiaoq_bj@126.com> XiaoZhihong<hondaxiao@tencent.com> WuPengqiang<pengqiang.wpq@alibaba-inc.com> XiaLixin<xialixin@kanzhun.com> LiPeng<lipeng19811218@gmail.com> ChenGuanghua<jinxue.cgh@alibaba-inc.com> ChenHaibo<nmgchenhaibo@foxmail.com> ZhangJunqin<chundonglinlin@126.com> and https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] cwd=/srs/trunk, work_dir=./, build: 2025-07-17 17:53:32, configure: --srt=on --sanitizer=off, uname: Linux VM-20-12-ubuntu 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux, osx: 0, env: 0, pkg: [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] configure detail: --prefix=/usr/local/srs --config=conf/srs.conf --osx=off --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=off --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-converter=on --http-api=on --utest=off --srt=on --sys-srt=off --rtc=on --h265=on --gb28181=off --simulator=off --cxx11=on --cxx14=off --backtrace=on --ffmpeg-fit=on --sys-ffmpeg=off --ffmpeg-opus=off --nasm=on --srtp-nasm=on --sys-srtp=off --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --shared-st=off --shared-srt=reserved --shared-ffmpeg=reserved --shared-srtp=reserved --log-verbose=off --log-info=off --log-trace=on --log-level_v2=on --gcov=off --apm=off --debug=off --debug-stats=off --cross-build=off --sanitizer=off --sanitizer-static=off --sanitizer-log=off --cygwin64=off --single-thread=off --generic-linux=off --build-cache=on --cc=gcc --cxx=g++ --ar=ar --ld=ld --randlib=randlib [2025-07-17 18:05:01.091][INFO][503706][3vf0j07n] srs checking config... [2025-07-17 18:05:01.091][ERROR][503706][3vf0j07n][22] Failed, code=1023(ConfigInvalid)(Configuration is invalid) : check config : check normal : illegal srt_server.stream thread [503706][3vf0j07n]: do_main() [./src/main/srs_main_server.cpp:225][errno=22] thread [503706][3vf0j07n]: check_config() [./src/app/srs_app_config.cpp:2287][errno=22] thread [503706][3vf0j07n]: check_normal_config() [./src/app/srs_app_config.cpp:2385][errno=22](Invalid argument)
最新发布
07-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Miss糖豆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值