From e357c243e01e1972659db09bda32e8d1e4a04330 Mon Sep 17 00:00:00 2001
From: Wenchao Hao <haowenchao@huawei.com>
Date: Fri, 29 Jan 2021 15:58:40 +0800
Subject: [PATCH] Modify iscsid.service to keep same with previous version

Mainly change is service iscsid work mode is changed from
notify to fork.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
---
 etc/systemd/iscsid.service | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
index 648ceea..be51f11 100644
--- a/etc/systemd/iscsid.service
+++ b/etc/systemd/iscsid.service
@@ -1,18 +1,17 @@
 [Unit]
 Description=Open-iSCSI
-Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
+Documentation=man:iscsid(8) man:iscsiadm(8)
+After=network.target
 DefaultDependencies=no
-After=network.target iscsiuio.service
-Before=remote-fs-pre.target
-Wants=remote-fs-pre.target
 
 [Service]
-Type=notify
-NotifyAccess=main
-ExecStart=/sbin/iscsid -f
-KillMode=mixed
-Restart=on-failure
+Type=forking
+PIDFile=/run/iscsid.pid
+ExecStart=/sbin/iscsid
+ExecStartPost=/usr/bin/sleep 1
+ExecStop=/sbin/iscsiadm -k 0 2
+Restart=always
+RestartSec=2s
 
 [Install]
 WantedBy=multi-user.target
-Also=iscsid.socket
-- 
1.8.3.1

