Skip to content
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

telegraf.service remove curly brackets on $TELEGRAF_OPTS #3354

Merged

Conversation

clheikes
Copy link
Contributor

With the brackets you cannot add more than 1 flag to the ExecStart command. Flags that require arguments will not work.

The following addition to /etc/default/telegraf gives a "flag provided but not defined" ERROR and the service fails to start. Removing the brackets from $TELEGRAF_OPTS fixes this.

#/etc/default/telegraf
TELEGRAF_OPTS=-pidfile /var/run/telegraf/telegraf.pid

log: flag provided but not defined: -pidfile /var/run/telegraf/telegraf.pid

https://www.freedesktop.org/software/systemd/man/systemd.service.html
"Use "${FOO}" as part of a word, or as a word of its own, on the command line, in which case it will be replaced by the value of the environment variable including all whitespace it contains, resulting in a single argument. Use "$FOO" as a separate word on the command line, in which case it will be replaced by the value of the environment variable split at whitespace, resulting in zero or more arguments. "

https://www.freedesktop.org/software/systemd/man/systemd.service.html

Basic environment variable substitution is supported. Use "${FOO}" as part of a word, or as a word of its own, on the command line, in which case it will be replaced by the value of the environment variable including all whitespace it contains, resulting in a single argument. Use "$FOO" as a separate word on the command line, in which case it will be replaced by the value of the environment variable split at whitespace, resulting in zero or more arguments. For this type of expansion, quotes are respected when splitting into words, and afterwards removed.
@phemmer
Copy link
Contributor

phemmer commented Oct 18, 2017

heh, this exact same issue came up on InfluxDB just a couple weeks ago: influxdata/influxdb#8909

@danielnelson danielnelson added this to the 1.4.3 milestone Oct 18, 2017
@danielnelson danielnelson merged commit 02baa69 into influxdata:master Oct 18, 2017
danielnelson pushed a commit that referenced this pull request Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants