From 0d3c9018af8aea2b948d8ae1c6469cf909f05e49 Mon Sep 17 00:00:00 2001 From: Brian M Date: Wed, 22 Oct 2025 14:19:18 -0700 Subject: [PATCH] debian, scstadmin: Add systemd scst.service Add systemd service file when packaging for Debian. Current systemd will automatically generate one, but this functionality will be removed in a future version of systemd. --- debian/rules | 1 + debian/scstadmin.install | 1 + scstadmin/Makefile | 6 ++++++ scstadmin/systemd/scst.service | 20 ++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 scstadmin/systemd/scst.service diff --git a/debian/rules b/debian/rules index 8424310e4..945592b7f 100755 --- a/debian/rules +++ b/debian/rules @@ -90,6 +90,7 @@ install: mv "$(DESTDIR)"/usr/man "$(DESTDIR)"/usr/share/man && \ dh_install && \ dh_installman && \ + dh_installsystemd --name=scst --no-start && \ dh_installchangelogs && \ dh_compress && \ dh_fixperms && \ diff --git a/debian/scstadmin.install b/debian/scstadmin.install index 00d0fe178..68a385c5c 100644 --- a/debian/scstadmin.install +++ b/debian/scstadmin.install @@ -1,4 +1,5 @@ etc/init.d/scst +lib/systemd/system/scst.service usr/sbin/scstadmin usr/share/perl/ usr/lib/ diff --git a/scstadmin/Makefile b/scstadmin/Makefile index ae3c4ec1b..a839f16a9 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -110,6 +110,12 @@ install install_vendor: mkdir -p $(DESTDIR)$(DEFAULTDIR); \ install -m 755 default/scst $(DESTDIR)$(DEFAULTDIR); \ fi + # Install systemd service file + if [ -d systemd ]; then \ + install -d $(DESTDIR)/lib/systemd/system; \ + install -m 644 systemd/scst.service \ + $(DESTDIR)/lib/systemd/system/scst.service; \ + fi for s in iscsi-scst qla2x00t; do \ { $(call REMOVE_FN,$$s); } >/dev/null 2>&1; \ done diff --git a/scstadmin/systemd/scst.service b/scstadmin/systemd/scst.service new file mode 100644 index 000000000..bb763f2cf --- /dev/null +++ b/scstadmin/systemd/scst.service @@ -0,0 +1,20 @@ +[Unit] +Description=SCST - A Generic SCSI Target Subsystem +Documentation=man:scstadmin(1) man:scst.conf(5) +After=network-online.target local-fs.target +Wants=network-online.target +DefaultDependencies=no +Before=shutdown.target + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=-/etc/default/scst +ExecStart=/etc/init.d/scst start +ExecStop=/etc/init.d/scst stop +ExecReload=/etc/init.d/scst reload +TimeoutStartSec=5min +TimeoutStopSec=5min + +[Install] +WantedBy=multi-user.target