Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Configuration file supports FHS specification, /etc/srs/srs.conf #2711

Closed
wants to merge 1 commit into from

Conversation

purplegrape
Copy link
Contributor

@purplegrape purplegrape commented Nov 4, 2021

Suggest referring to the FHS (Filesystem Hierarchy Standard) directory standard and setting the default configuration file to /etc/srs/srs.conf. If the -c option is used to specify a configuration file, it will take precedence. (I am not a programmer, please forgive me)


TRANS_BY_GPT3

建议参考FHS文件目录标准,设置默认配置文件指定为/etc/srs/srs.conf , 如-c 指定配置文件,则按指定的为准
(本人非码农,见谅)
@winlinvip
Copy link
Member

winlinvip commented Nov 7, 2021

@purplegrape Thanks a lot

I make a little change and merge as 1f4dad0

However, I still prioritize local configuration. First, I look for the configuration specified by the user, then I look for the default conf/srs.conf, and finally, I look for /etc/srs/srs.conf.

TRANS_BY_GPT3

@winlinvip winlinvip closed this Nov 7, 2021
@winlinvip winlinvip self-assigned this Nov 7, 2021
@purplegrape
Copy link
Contributor Author

purplegrape commented Nov 8, 2021

Suggest putting the default configuration in the compilation parameters, as there are many parameters involved, which is a sign of software maturity in accordance with FHS.

Refer to the compilation parameters of nginx.
--prefix=/usr/share/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--pid-path=/run/nginx.pid

In addition, it is more refreshing to start without any parameters by default, and it is also recommended to refer to nginx, which is equivalent to -c /etc/xx.conf.

Finally, it is not recommended for software to be designed for multiple local instances from the beginning. Simply copying the parent directory and changing the configuration file port can generate a new instance. This is a lazy approach. Multiple instances should be specified by different configuration files, and the paths should be written within the configuration files.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Dec 22, 2021

Currently, when the SRS is configured in a way that does not match the user-specified configuration file, it will print a warning and provide the used configuration file:

$ ./objs/srs
[2021-12-22 13:08:58.706][Trace][95002][d81x10st] XCORE-SRS/4.0.207(Leo)
[2021-12-22 13:08:58.707][Warn][95002][d81x10st][2] user config  does not exists, use conf/srs.conf instead

As well as the attempted configuration files that were not found:

$ ~/srs/objs/srs -c user/docker.conf
[2021-12-22 13:06:42.387][Trace][94789][20v73877] XCORE-SRS/4.0.207(Leo)
[2021-12-22 13:06:42.388][Error][94789][20v73877][2] Failed, code=1023 : config parse options : no config file at 
user/docker.conf, user/srs.conf, conf/srs.conf, /etc/srs/srs.conf
thread [94789][20v73877]: do_main() [src/main/srs_main_server.cpp:108][errno=2]
thread [94789][20v73877]: parse_options() [src/app/srs_app_config.cpp:2011][errno=2](No such file or directory)

Other suggestions, if you find them important, please submit a pull request (PR).

TRANS_BY_GPT3

@winlinvip winlinvip changed the title 设置默认配置文件 配置文件支持FHS规范,/etc/srs/srs.conf Dec 22, 2021
@winlinvip winlinvip changed the title 配置文件支持FHS规范,/etc/srs/srs.conf Configuration file supports FHS specification, /etc/srs/srs.conf Jul 29, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants