Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

use of $ARGS in systemd unit file by prometheus package

652 views
Skip to first unread message

Andrew Spiers

unread,
Mar 1, 2021, 9:20:05 PM3/1/21
to
Prometheus takes some command line arguments to control certain
aspects of its operation.
The systemd unit file shipped with prometheus includes the line

ExecStart=/usr/bin/prometheus $ARGS

I know I can simply override the unit file with one in
/etc/systemd/system, but what if I wanted to use this variable? Where
would I set it?

IL Ka

unread,
Mar 1, 2021, 9:50:04 PM3/1/21
to
Hi.

ExecStart=/usr/bin/prometheus $ARGS

I know I can simply override the unit file with one in
/etc/systemd/system, but what if I wanted to use this variable? Where
would I set it?

Andrew Spiers

unread,
Mar 2, 2021, 2:00:05 AM3/2/21
to
Thanks.

I think EnvironmentFile is just used for setting the environment file
of the running process.
Setting ARGS in /etc/default/prometheus seems to add the value to the
command line arguments, as well as to an environment variable called
ARGS for the prometheus process.
I can't find any mention of this in the systemd or prometheus docs,
but it works.

Greg Wooledge

unread,
Mar 2, 2021, 10:20:04 AM3/2/21
to
Andrew Spiers (and...@andrewspiers.net) wrote:
> I think EnvironmentFile is just used for setting the environment file
> of the running process.
> Setting ARGS in /etc/default/prometheus seems to add the value to the
> command line arguments, as well as to an environment variable called
> ARGS for the prometheus process.
> I can't find any mention of this in the systemd or prometheus docs,
> but it works.

Show us the systemd unit file, or a URL that points to it exactly as it
appears on your system. (Hint: if it's a Debian package, and if you're
using the unmodified Debian systemd unit file, you might be able to
find it on sources.debian.org. If this is the case, tell us what version
of the Debian package you're using. For example, buster's is at
<https://sources.debian.org/src/prometheus/2.7.1+ds-3/debian/service/>.)

It might also help if you try "systemctl status prometheus" (or whatever
the unit's name is) and show us what it says. Just in case the systemd
unit is merely a thin wrapper around a sysv-rc script, as is sometimes
the case.

It's worth noting that the Debian /etc/default/prometheus file from
buster's package
(<https://sources.debian.org/src/prometheus/2.7.1+ds-3/debian/default/>)
explicitly sets a variable named ARGS.
0 new messages