Package: prometheus-postfix-exporter
Version: 0.12.1-1
Tags: patch

systemd is the default init system on Debian and the persistent journal 
is enabled by default. It would be nice if prometheus-postfix-exporter 
could use this rather than installing rsyslog and requiring an 
additional logging system.

To get there, I propose adding a systemd-sysv as an alternative to 
rsyslog. It cannot provide system-log-daemon, because that would prevent 
the systemd from being used with rsyslog. Then to actually use the 
journal one has to pass --systemd.enable, but we don't want to pass this 
when running under sysvinit. So I propose adding ARGS_SYSTEMD to the 
defaults file. This separate variable is only consumed by the systemd 
unit which now defaults to --systemd.enable.

What do you think?

Helmut
diff -Nru prometheus-postfix-exporter-0.12.1/debian/changelog 
prometheus-postfix-exporter-0.12.1/debian/changelog
--- prometheus-postfix-exporter-0.12.1/debian/changelog 2025-08-21 
20:07:12.000000000 +0200
+++ prometheus-postfix-exporter-0.12.1/debian/changelog 2025-09-18 
16:37:49.000000000 +0200
@@ -1,3 +1,10 @@
+prometheus-postfix-exporter (0.12.1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use the journal when running under systemd. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Thu, 18 Sep 2025 16:37:49 +0200
+
 prometheus-postfix-exporter (0.12.1-1) unstable; urgency=medium
 
   * New upstream release (fork)
diff -Nru prometheus-postfix-exporter-0.12.1/debian/control 
prometheus-postfix-exporter-0.12.1/debian/control
--- prometheus-postfix-exporter-0.12.1/debian/control   2025-08-21 
20:07:12.000000000 +0200
+++ prometheus-postfix-exporter-0.12.1/debian/control   2025-09-18 
16:37:49.000000000 +0200
@@ -32,7 +32,7 @@
 Depends: adduser,
          daemon | systemd-sysv,
          postfix,
-         rsyslog | system-log-daemon,
+         rsyslog | system-log-daemon | systemd-sysv,
          ${misc:Depends},
          ${shlibs:Depends},
 Static-Built-Using: ${misc:Static-Built-Using}
diff -Nru prometheus-postfix-exporter-0.12.1/debian/default 
prometheus-postfix-exporter-0.12.1/debian/default
--- prometheus-postfix-exporter-0.12.1/debian/default   2025-08-21 
20:07:12.000000000 +0200
+++ prometheus-postfix-exporter-0.12.1/debian/default   2025-09-18 
16:37:49.000000000 +0200
@@ -3,3 +3,4 @@
 # them (\\d for \d). If running under systemd, you need to double them again
 # (\\\\d to mean \d), and escape newlines too.
 ARGS=""
+ARGS_SYSTEMD="--systemd.enable"
diff -Nru prometheus-postfix-exporter-0.12.1/debian/service 
prometheus-postfix-exporter-0.12.1/debian/service
--- prometheus-postfix-exporter-0.12.1/debian/service   2025-08-21 
20:07:12.000000000 +0200
+++ prometheus-postfix-exporter-0.12.1/debian/service   2025-09-18 
16:37:49.000000000 +0200
@@ -7,7 +7,7 @@
 User=prometheus
 SupplementaryGroups=adm postdrop
 EnvironmentFile=/etc/default/prometheus-postfix-exporter
-ExecStart=/usr/bin/prometheus-postfix-exporter $ARGS
+ExecStart=/usr/bin/prometheus-postfix-exporter $ARGS $ARGS_SYSTEMD
 
 [Install]
 WantedBy=multi-user.target

Reply via email to