mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Obtain advisory lock on ZED PID file
ZED uses an advisory lock on its state file to protect against multiple instances running concurrently. However, work is planned to move this state information into the kernel, and ZED will still need to protect against starting multiple instances. This commit adds an advisory lock on the PID file to protect against starting multiple instances. A lock failure can be overridden with the "-f" (force) command-line option. The advisory lock on the state file is being retained for as long as the state information is stored in the state file. Signed-off-by: Chris Dunlap <cdunlap@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #2756
This commit is contained in:
committed by
Brian Behlendorf
parent
057485504e
commit
56697c4264
+2
-1
@@ -259,7 +259,8 @@ main(int argc, char *argv[])
|
||||
if (zcp->do_memlock)
|
||||
_lock_memory();
|
||||
|
||||
(void) zed_conf_write_pid(zcp);
|
||||
if ((zed_conf_write_pid(zcp) < 0) && (!zcp->do_force))
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
if (!zcp->do_foreground)
|
||||
_finish_daemonize();
|
||||
|
||||
Reference in New Issue
Block a user