tgt/tgt-systemd-service-update.patch

49 lines
1.3 KiB
Diff
Raw Normal View History

From: Lee Duncan
Date: Sat 24 Dec 2022 09:15:40 AM PST
Subject: [PATCH] tgt: systemd service update
Update our systemd service file to match what we do at SUSE.
---
--- a/scripts/tgtd.service
+++ b/scripts/tgtd.service
@@ -1,11 +1,7 @@
[Unit]
Description=iSCSI target framework daemon
-Documentation=man: tgtd(8)
+Documentation=man:tgtd(8)
After=network.target
-
-# On systems without virtual consoles, don't start any getty. Note
-# that serial gettys are covered by serial-getty@.service, not this
-# unit.
ConditionPathExists=/etc/tgt/targets.conf
[Service]
@@ -18,10 +14,14 @@ ProtectKernelTunables=true
ProtectKernelLogs=true
RestrictRealtime=true
# end of automatic additions
-Type=forking
+
Environment=TGTD_CONFIG=/etc/tgt/targets.conf
+EnvironmentFile=-/etc/sysconfig/tgt
+
+Type=forking
+
+ExecStart=/usr/sbin/tgtd $TGTD_OPTS
-ExecStart=/usr/sbin/tgtd
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v offline
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v ready
ExecStartPost=/usr/sbin/tgt-admin -e -c ${TGTD_CONFIG}
@@ -33,8 +33,6 @@ ExecStop=/usr/sbin/tgt-admin --offline A
ExecStop=/usr/sbin/tgt-admin --update ALL -c /dev/null -f
ExecStop=/usr/sbin/tgtadm --op delete --mode system
-# Exit code: 107 tgtd not running
-
[Install]
WantedBy=multi-user.target