Package: diod
Version: 1.0.24-5.2
Followup-For: Bug #1039174
User: [email protected]
Usertags: origin-ubuntu stonking ubuntu-patch
Control: tags -1 patch
Dear Maintainer,
In Ubuntu, we started shipping the upstream systemd service with some
slight changes:
* Ship systemd service (LP: #2153841, Closes: #1039174):
- d/p/systemd.patch: fix systemd service for use in Debian/Ubuntu
- d/rules: stop removing systemd units
Thanks for considering the patch.
-Nick
diff -Nru diod-1.0.24/debian/patches/series diod-1.0.24/debian/patches/series
--- diod-1.0.24/debian/patches/series 2020-03-16 18:20:44.000000000 -0400
+++ diod-1.0.24/debian/patches/series 2026-09-08 17:29:39.000000000 -0400
@@ -3,3 +3,4 @@
disable-xattr-tests.diff
include-sysmacros_h.diff
0005-Use-sys-xattr.h-instead-of-attr-xattr.h.patch
+systemd.patch
diff -Nru diod-1.0.24/debian/patches/systemd.patch
diod-1.0.24/debian/patches/systemd.patch
--- diod-1.0.24/debian/patches/systemd.patch 1969-12-31 19:00:00.000000000
-0500
+++ diod-1.0.24/debian/patches/systemd.patch 2026-09-08 17:29:39.000000000
-0400
@@ -0,0 +1,38 @@
+From: Nick Rosbrook <[email protected]>
+Date: Tue, 8 Sep 2026 16:56:36 -0400
+Subject: scripts: fix systemd service for use in Debian/Ubuntu
+
+This patch addresses two issues:
+
+First, packages must install systemd units to /usr/lib, not /etc.
+
+Second, the default /etc/diod.conf does not define exports, which causes
+the included service to fail to start. Add ExecCondition= to test the
+config first.
+---
+ scripts/Makefile.am | 2 +-
+ scripts/diod.service.in | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/Makefile.am b/scripts/Makefile.am
+index 51c24a3..17211b5 100644
+--- a/scripts/Makefile.am
++++ b/scripts/Makefile.am
+@@ -1,4 +1,4 @@
+-systemddir=$(sysconfdir)/systemd/system
++systemddir=/usr/lib/systemd/system
+
+ install-data-local:
+ $(top_srcdir)/config/install-sh -m 755 $(srcdir)/auto.diod \
+diff --git a/scripts/diod.service.in b/scripts/diod.service.in
+index 1f9f973..6b7df9a 100644
+--- a/scripts/diod.service.in
++++ b/scripts/diod.service.in
+@@ -3,6 +3,7 @@ Description=9P File Server
+
+ [Service]
+ Type=forking
++ExecCondition=@X_SBINDIR@/diod -s
+ ExecStart=@X_SBINDIR@/diod
+
+ [Install]
diff -Nru diod-1.0.24/debian/rules diod-1.0.24/debian/rules
--- diod-1.0.24/debian/rules 2025-09-22 07:45:06.000000000 -0400
+++ diod-1.0.24/debian/rules 2026-09-08 17:28:36.000000000 -0400
@@ -22,4 +22,3 @@
override_dh_auto_install:
dh_auto_install
mv debian/diod/etc/auto.diod debian/diod/usr/share/doc/diod/examples
- rm -r debian/diod/etc/systemd