Server Config Location on Linux
Problem Statement
Currently, the location of the server configuration files (config, user list for file-based authentication, permissions) seems to differ across Linux distributions (see this GitHub comment).
Linux Filesystem Conventions
Usually, system-wide configuration can be found in /etc (source), user-specific configuration can be found in a hidden file in the user's home directory or in non-hidden files in a hidden directory (https://stackoverflow.com/a/1024121), some applications look in the current working directory for config files where this is useful, and the command can be used to specify config file locations. The priority of the possible locations in decreasing order is usually as follows:
- command line or environment variables,
- current working directory,
- user's home directory,
/etc.
Often, select options can be overridden with command line parameters or environment variables. Finally, an application has to specify if it reads all available configuration files or only the first config encountered by the program. If the application reads all available configuration data, then it has to define how multiple occurrences of the same parameters are handled.
Since deepstream is not a graphical application, it can probably ignore the XDG Base Directory Specification (XDG stands for X Desktop Group, nowadays known as freedesktop.org).
Examples
The revision control system git reads the following config files (in this order):
/etc/gitconfig,$XDG_CONFIG_HOME/git/config,~/.gitconfig, and- the current git repository if the current working directory is part of a git repository.
Options given multiple times are overwritten by files read later (https://git-scm.com/docs/git-config) and options provided on the command line have the highest priority.
Case Study: Apache HTTP and nginx
I briefly talk about the behavior of the webservers nginx and the Apache HTTP Server.
The standard location of the config file is PREFIX/conf/httpd.conf though Ubuntu, Debian, and Gentoo move this file to /etc/apache2/ (source 1, source 2), where PREFIX is the value of the --prefix option set at compile time. The nginx configuration file location is not uniquely specified in the documentation (example), but often it can be found at /etc/nginx/nginx.conf, e.g., on Ubuntu, Debian, and Gentoo (source 1, source 2, source 3).
Solution Proposal
Based on the behavior of Apache HTTP and nginx, I propose that deepstream on
Linux should move its configuration files to /etc/deepstream unless it was installed with npm.
I believe this is how it works now. Unless I'm totally incorrect
This issue documentation is <3

cool, thanks!
For path references, using pwd is a lil easier to prove absolute paths ;)
Is it possible to override configs with environment variables or command line arguments?