]> granicus.if.org Git - zfs/commit
Obtain advisory lock on ZED PID file
authorChris Dunlap <cdunlap@llnl.gov>
Wed, 1 Oct 2014 21:56:07 +0000 (14:56 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Oct 2014 20:17:40 +0000 (13:17 -0700)
commit56697c42646f002c4f52f9569a8cb75b45f704d8
treec1fe2889a109c7879b6686d900ae5cfb63fb3543
parent057485504e3a4502c265813ab58e9ec8ffc2a3be
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
cmd/zed/zed.c
cmd/zed/zed_conf.c
cmd/zed/zed_conf.h