-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generated config file should have canonical paths by default, not ~ #6392
Comments
@rossmcdonald am I missing something? |
Looks like it's not OS X specific. The data directories are set to the user's directory. https://github.com/influxdata/influxdb/blob/master/cmd/influxd/run/config.go#L100 Should be pretty easy to set the directory name as a build flag and add support for the correct data directories names per distribution to the build script. |
Yep, the generated paths default to putting everything under |
Confirmed it's using |
Alternately, can we put something in the config file or the upgrade instructions that gives a one-liner for the conversion? Something like |
The primary reason for this is so that it's possible to run the binary easily when run as non-root. This is essential for us as developers as we don't want to have to generate a config when we're testing locally or run the application as root on our development machines. It's possible for us to detect when the user is root and change the config locations, but it's inadvisable to run the server as root anyway and we would then have to hard code the username. It's much easier to just have the package include a config with the appropriate paths that gets run or have them set by environment variables as part of the init script. If we're concerned about the binary writing to |
My concern is not really about |
You can use env vars to generate a config with different defaults:
|
The config path previously could only be specified through the command line options. This made it very difficult to set a default config path without using any option. Now the environment variable can be set so the default configuration path is set to a specific place, but can be overwritten using the command line option. The primary purpose of this is so the Docker container can have a default configuration file, but not have to parse the command line options to figure out if a different configuration file has been specified while still allowing the user to only type `influxd` and have the program start correctly. This might also help #6392 as it would allow a default configuration location to be included with the package by setting an environment variable. A default search path is also provided now with checking the following paths for a config file when none is specified: * `~/.influxdb/influxdb.conf` * `/etc/influxdb/influxdb.conf`
The config path previously could only be specified through the command line options. This made it very difficult to set a default config path without using any option. Now the environment variable can be set so the default configuration path is set to a specific place, but can be overwritten using the command line option. The primary purpose of this is so the Docker container can have a default configuration file, but not have to parse the command line options to figure out if a different configuration file has been specified while still allowing the user to only type `influxd` and have the program start correctly. This might also help #6392 as it would allow a default configuration location to be included with the package by setting an environment variable. A default search path is also provided now with checking the following paths for a config file when none is specified: * `~/.influxdb/influxdb.conf` * `/etc/influxdb/influxdb.conf` The config command has also been modified to read this config file before outputting a sample config.
Closing this since the config file installed via packages have the correct paths and you should not be generating a config when using the packages. |
Bug report
System info: [Include InfluxDB version, operating system name, and other relevant details]
InfluxDB 0.12, any non-OS X system
According to @rkuchan in influxdata/docs.influxdata.com-ARCHIVE#390 (comment), the generated config file has OS X specific paths for the meta, data, and wal directoies.
Expected behavior: [What you expected to happen]
I think we should default to Linux paths, not OS X.
The text was updated successfully, but these errors were encountered: