diff options
author | Olaf Faaland <[email protected]> | 2020-02-25 16:02:10 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-25 16:02:10 -0800 |
commit | 034313908a3fa3661d6c2f7392294a64b41d60f8 (patch) | |
tree | 6c7ea6f538e959b2c16c742e19b80365777fe7a3 /tests/zfs-tests/include | |
parent | c6a6b4d50a71108e053c19418e0f423533cfe7d1 (diff) |
ZTS: zed_start should not fail if zed is already running
zed_start may be called in places where zed is not
typically already running, but this is not a requirement
of the tests.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Olaf Faaland <[email protected]>
Closes #9974
Diffstat (limited to 'tests/zfs-tests/include')
-rw-r--r-- | tests/zfs-tests/include/libtest.shlib | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index e95d2edb8..81c4067ea 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -3621,16 +3621,16 @@ function zed_start # Verify the ZED is not already running. pgrep -x zed > /dev/null if (($? == 0)); then - log_fail "ZED already running" + log_note "ZED already running" + else + log_note "Starting ZED" + # run ZED in the background and redirect foreground logging + # output to $ZED_LOG. + log_must truncate -s 0 $ZED_DEBUG_LOG + log_must eval "zed -vF -d $ZEDLET_DIR -p $ZEDLET_DIR/zed.pid -P $PATH" \ + "-s $ZEDLET_DIR/state 2>$ZED_LOG &" fi - log_note "Starting ZED" - # run ZED in the background and redirect foreground logging - # output to $ZED_LOG. - log_must truncate -s 0 $ZED_DEBUG_LOG - log_must eval "zed -vF -d $ZEDLET_DIR -p $ZEDLET_DIR/zed.pid -P $PATH" \ - "-s $ZEDLET_DIR/state 2>$ZED_LOG &" - return 0 } |