diff options
author | Chris Dunlap <[email protected]> | 2014-10-01 14:56:07 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-10-06 13:17:40 -0700 |
commit | 56697c42646f002c4f52f9569a8cb75b45f704d8 (patch) | |
tree | c1fe2889a109c7879b6686d900ae5cfb63fb3543 /cmd/zed/zed_conf.h | |
parent | 057485504e3a4502c265813ab58e9ec8ffc2a3be (diff) |
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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #2756
Diffstat (limited to 'cmd/zed/zed_conf.h')
-rw-r--r-- | cmd/zed/zed_conf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/zed/zed_conf.h b/cmd/zed/zed_conf.h index 126075842..20e04039b 100644 --- a/cmd/zed/zed_conf.h +++ b/cmd/zed/zed_conf.h @@ -42,6 +42,7 @@ struct zed_conf { int max_events; /* RESERVED FOR FUTURE USE */ char *conf_file; /* abs path to config file */ char *pid_file; /* abs path to pid file */ + int pid_fd; /* fd to pid file for lock */ char *zedlet_dir; /* abs path to zedlet dir */ zed_strings_t *zedlets; /* names of enabled zedlets */ char *state_file; /* abs path to state file */ |