Skip to contentSkip to conversation

nfs-blkmapd: Fix the error status when nfs-blkmapd stops

PATCH In review zhanchengbin 3 participants 3 messages Sep 1, 2022 – Sep 13, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-blkmapd: Fix the error status when nfs-blkmapd stops

The systemctl stop nfs-blkmap.service will sends the SIGTERM signal to the nfs-blkmap.service first.If the process fails to be stopped, it sends the SIGKILL signal again to kill the process. However, exit(1) is executed in the SIGTERM processing function of nfs-blkmap.service. As a result, systemd receives an error message indicating that nfs-blkmap.service failed.
"Active: failed" is displayed when the systemctl status nfs-blkmap.service command is executed.

---
 utils/blkmapd/device-discovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/blkmapd/device-discovery.c +1 -1
index 2736ac89..49935c2e 100644
@@ -462,7 +462,7 @@ static void sig_die(int signal)
 		unlink(PID_FILE);
 	}
 	BL_LOG_ERR("exit on signal(%d)\n", signal);
-	exit(1);
+	exit(0);
 }
 static void usage(void)
 {
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · zhanchengbin

The systemctl stop nfs-blkmap.service will sends the SIGTERM signal to the nfs-blkmap.service first.If the process fails to be stopped, it sends the SIGKILL signal again to kill the process. However, exit(1) is executed in the SIGTERM processing function of nfs-blkmap.service. As a result, systemd receives an error message indicating that nfs-blkmap.service failed.
"Active: failed" is displayed when the systemctl status nfs-blkmap.service command is executed.

Looks good:

#2 lore raw
In reply to zhanchengbin
Quoted 10 lines · zhanchengbin

The systemctl stop nfs-blkmap.service will sends the SIGTERM signal to the nfs-blkmap.service first.If the process fails to be stopped, it sends the SIGKILL signal again to kill the process. However, exit(1) is executed in the SIGTERM processing function of nfs-blkmap.service. As a result, systemd receives an error message indicating that nfs-blkmap.service failed.
"Active: failed" is displayed when the systemctl status nfs-blkmap.service command is executed.

Committed... (tag: nfs-utils-2-6-3-rc1)

steved.

Quoted 17 lines
---
  utils/blkmapd/device-discovery.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
utils/blkmapd/device-discovery.c +1 -1
index 2736ac89..49935c2e 100644
@@ -462,7 +462,7 @@ static void sig_die(int signal)
          unlink(PID_FILE);
      }
      BL_LOG_ERR("exit on signal(%d)\n", signal);
-    exit(1);
+    exit(0);
  }
  static void usage(void)
  {