Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 908437 - dev-db/influxdb-2.7.1-r1: Openrc startscript searches for non existing config file.
Summary: dev-db/influxdb-2.7.1-r1: Openrc startscript searches for non existing config...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-13 10:39 UTC by Norman Rieß
Modified: 2023-11-04 17:28 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Rieß 2023-06-13 10:39:56 UTC
dev-db/influxdb-2.7.1-r1 does not install a config file to /etc/influxdb/influxdb.conf as it is not needed.
But the OpenRC startscript is searching for this file and quits, if it is not present.
If you comment out the inclusion of the config file and the test, if it exists, influxdb runs fine.

Reproducible: Always

Steps to Reproduce:
1. Emerge >=influxdb-2.7
2. Start via /etc/init.d/influxdb
3. Start fails because of missing file /etc/influxdb/influxdb.conf
Actual Results:  
* config file /etc/influxdb/influxdb.conf doesn't exist
* ERROR: influxdb failed to start

Expected Results:  
* Caching service dependencies ...        [ ok ]
 * Starting influxdb ...                  [ ok ]
Comment 1 Pedro 2023-06-17 09:47:16 UTC
I also don't think the init.d script its entirelly correct, since the command_args that has defined are not supported by influxd binary:
config="${config:-/etc/influxdb/influxdb.conf}"
command_args="-config ${config} ${influxd_opts}"

If run in cli or via init.d you get the following error:
# influxd -config /etc/influxdb/influxdb.conf
Error: unknown shorthand flag: 'c' in -config
See 'influxd -h' for help

The correct way of running 2.X seems to be with 'influxd run', as the configuration file is either overriden by individual flags (I didn't saw a flag to just send the entire conf, just to update some values), via env variables or via the default conf path. As stated from the help:
Start up the daemon configured with flags/env vars/config file.

The order of precedence for config options are as follows (1 highest, 3 lowest):
        1. flags
        2. env vars
        3. config file

A config file can be provided via the INFLUXD_CONFIG_PATH env var. If a file is
not provided via an env var, influxd will look in the current directory for a
config.{json|toml|yaml|yml} file. If one does not exist, then it will continue unchanged.