Skip to content

Commit

Permalink
Allow to redefine parameters in systemd unit via env file.
Browse files Browse the repository at this point in the history
It's very important to use  use $ARGS,  not ${ARGS}.
See man for systemd. For example on Ubuntu: https://manpages.ubuntu.com/manpages/focal/man5/systemd.service.5.html
  • Loading branch information
woblerr committed Nov 16, 2024
1 parent 6f2d3df commit 9ccbfd4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions authlog_exporter.service.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Description=authlog_exporter

[Service]
Type=simple
Environment="AUTH_LOG_PATH=/var/log/auth.log"
Environment="EXPORTER_ENDPOINT=/metrics"
Environment="EXPORTER_PORT=9991"
ExecStart=/usr/bin/authlog_exporter --auth.log=${AUTH_LOG_PATH} --web.endpoint=${EXPORTER_ENDPOINT} --web.listen-address=:${EXPORTER_PORT}
Environment="ARGS=--auth.log=/var/log/auth.log --web.endpoint=/metrics --web.listen-address=:9991"
EnvironmentFile=-/etc/default/authlog_exporter
ExecStart=/usr/bin/authlog_exporter $ARGS
Restart=always
RestartSec=5s

Expand Down

0 comments on commit 9ccbfd4

Please sign in to comment.