Couple of debian fixes, cannot use variable expansions this way

This commit is contained in:
2025-12-31 16:18:47 +01:00
parent fab5119fc2
commit 86369a77f7
5 changed files with 24 additions and 12 deletions

View File

@@ -32,11 +32,11 @@ sudo systemctl start bird-exporter
Default configuration: Default configuration:
``` ```
BIRD_RUN_USER=bird BIRD_EXPORTER_ARGS="-web.listen-address=:9324 -period=60s -bird.socket=/var/run/bird/bird.ctl"
BIRD_RUN_GROUP=bird
BIRD_EXPORTER_ARGS="-period=60s -bird.socket=/var/run/bird/bird.ctl"
``` ```
The service runs as the `bird` user and group.
## Documentation ## Documentation
- **Manual page**: `man bird-exporter` (after package installation) - **Manual page**: `man bird-exporter` (after package installation)

View File

@@ -1,8 +1,3 @@
# Default settings for bird-exporter # Default settings for bird-exporter
# User and group to run bird-exporter as
BIRD_RUN_USER=bird
BIRD_RUN_GROUP=bird
# Command line arguments to pass to bird-exporter # Command line arguments to pass to bird-exporter
BIRD_EXPORTER_ARGS="-period=60s -bird.socket=/var/run/bird/bird.ctl" BIRD_EXPORTER_ARGS="-web.listen-address=:9324 -period=60s -bird.socket=/var/run/bird/bird.ctl"

18
debian/bird-exporter.postinst vendored Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
set -e
case "$1" in
configure)
# Create bird user if it doesn't exist
if ! getent passwd bird > /dev/null; then
adduser --system --group --no-create-home \
--home /nonexistent \
--gecos "BIRD routing daemon" \
bird
fi
;;
esac
#DEBHELPER#
exit 0

View File

@@ -6,9 +6,9 @@ Wants=bird.service
[Service] [Service]
Type=simple Type=simple
User=bird
Group=bird
EnvironmentFile=-/etc/default/bird-exporter EnvironmentFile=-/etc/default/bird-exporter
User=${BIRD_RUN_USER:-bird}
Group=${BIRD_RUN_GROUP:-bird}
ExecStart=/usr/bin/bird-exporter $BIRD_EXPORTER_ARGS ExecStart=/usr/bin/bird-exporter $BIRD_EXPORTER_ARGS
Restart=always Restart=always
RestartSec=5 RestartSec=5

1
debian/rules vendored
View File

@@ -14,7 +14,6 @@ override_dh_auto_build:
override_dh_auto_install: override_dh_auto_install:
install -D -m 0755 bird-exporter debian/bird-exporter/usr/bin/bird-exporter install -D -m 0755 bird-exporter debian/bird-exporter/usr/bin/bird-exporter
install -D -m 0644 debian/bird-exporter.service debian/bird-exporter/lib/systemd/system/bird-exporter.service
install -D -m 0644 debian/bird-exporter.default debian/bird-exporter/etc/default/bird-exporter install -D -m 0644 debian/bird-exporter.default debian/bird-exporter/etc/default/bird-exporter
install -D -m 0644 docs/bird-exporter.1 debian/bird-exporter/usr/share/man/man1/bird-exporter.1 install -D -m 0644 docs/bird-exporter.1 debian/bird-exporter/usr/share/man/man1/bird-exporter.1