aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zed/zed_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/zed/zed_conf.c')
-rw-r--r--cmd/zed/zed_conf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/zed/zed_conf.c b/cmd/zed/zed_conf.c
index 78b45e910..e6f601f3a 100644
--- a/cmd/zed/zed_conf.c
+++ b/cmd/zed/zed_conf.c
@@ -430,7 +430,13 @@ zed_conf_scan_dir(struct zed_conf *zcp)
/*
* Write the PID file specified in [zcp].
* Return 0 on success, -1 on error.
- * XXX: This must be called after fork()ing to become a daemon.
+ * This must be called after fork()ing to become a daemon (so the correct PID
+ * is recorded), but before daemonization is complete and the parent process
+ * exits (for synchronization with systemd).
+ * FIXME: Only update the PID file after verifying the PID previously stored
+ * in the PID file no longer exists or belongs to a foreign process
+ * in order to ensure the daemon cannot be started more than once.
+ * (This check is currently done by zed_conf_open_state().)
*/
int
zed_conf_write_pid(struct zed_conf *zcp)