[...]
+ (patches
+ (search-patches
+ "restartd-fix-compilation.patch"
+ "restartd-add-error-handling-for-robustness.patch"))))
[...]
(define-public rex
(package
(name "rex")
diff --git
a/gnu/packages/patches/restartd-add-error-handling-for-robustness.patch
b/gnu/packages/patches/restartd-add-error-handling-for-robustness.patch
new file mode 100644
index 0000000000..f0abcf1dac
--- /dev/null
+++ b/gnu/packages/patches/restartd-add-error-handling-for-robustness.patch
@@ -0,0 +1,232 @@
+From ec606eb15091ff8ffa672500413128c29814f8ad Mon Sep 17 00:00:00 2001
+From: Yin Kangkai <yinkangkai@xiaomi.com>, Maxime Devos
<maximedevos@telenet.be>
+Date: Thu, 25 Aug 2022 14:29:25 +0200
+Subject: [PATCH] Add some error handling for robustness.
+
+This makes the code a little more robust. What if /var/run does not
+exist, or we do not have permission to open
+/var/run/restartd.pid (EPERM?) due to SELinux misconfiguration?
+This patch also avoids segmentation fault when run from non-root user.
+---
+[..]
+ for(i=0; i<config_process_number; i++) {
+ if (strlen(config_process[i].processes) > 0) {
+ if (strlen(config_process[i].running) > 0) {
+ strcpy(config_process[i].status, "running");
+- syslog(LOG_INFO, "%s is running, executing '%s'",
++ /* syslog(LOG_INFO, "%s is running, executing '%s'",
+ config_process[i].name,
+- config_process[i].running);
++ config_process[i].running); */