mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Emit history events for 'zpool create'
History commands and events were being suppressed for the 'zpool create' command since the history object did not yet exist. Create the object earlier so this history doesn't get lost. Split the pool_destroy event in to pool_destroy and pool_export so they may be distinguished. Updated events_001_pos and events_002_pos test cases. They now check for the expected history events and were reworked to be more reliable. Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #6712 Closes #6486
This commit is contained in:
@@ -179,6 +179,8 @@ if is_linux; then
|
||||
DEV_MPATHDIR="/dev/mapper"
|
||||
|
||||
ZEDLET_DIR="/var/tmp/zed"
|
||||
ZED_LOG="$ZEDLET_DIR/zed.log"
|
||||
ZED_DEBUG_LOG="$ZEDLET_DIR/zed.debug.log"
|
||||
VDEVID_CONF="$ZEDLET_DIR/vdev_id.conf"
|
||||
VDEVID_CONF_ETC="/etc/zfs/vdev_id.conf"
|
||||
|
||||
@@ -200,4 +202,4 @@ else
|
||||
fi
|
||||
export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
|
||||
ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR \
|
||||
ZEDLET_DIR VDEVID_CONF VDEVID_CONF_ETC
|
||||
ZEDLET_DIR ZED_LOG ZED_DEBUG_LOG VDEVID_CONF VDEVID_CONF_ETC
|
||||
|
||||
@@ -3361,11 +3361,14 @@ function zed_setup
|
||||
|
||||
# Customize the zed.rc file to enable the full debug log.
|
||||
log_must sed -i '/\#ZED_DEBUG_LOG=.*/d' $ZEDLET_DIR/zed.rc
|
||||
echo "ZED_DEBUG_LOG=$ZEDLET_DIR/zed.debug.log" >>$ZEDLET_DIR/zed.rc
|
||||
echo "ZED_DEBUG_LOG=$ZED_DEBUG_LOG" >>$ZEDLET_DIR/zed.rc
|
||||
|
||||
# Scripts must only be user writable.
|
||||
saved_umask=$(umask)
|
||||
log_must umask 0022
|
||||
log_must cp ${ZEDLET_LIBEXEC_DIR}/all-syslog.sh $ZEDLET_DIR
|
||||
log_must cp ${ZEDLET_LIBEXEC_DIR}/all-debug.sh $ZEDLET_DIR
|
||||
log_must touch $ZEDLET_DIR/zed.debug.log
|
||||
log_must umask $saved_umask
|
||||
}
|
||||
|
||||
#
|
||||
@@ -3381,10 +3384,9 @@ function zed_cleanup
|
||||
log_must rm -f ${ZEDLET_DIR}/zed-functions.sh
|
||||
log_must rm -f ${ZEDLET_DIR}/all-syslog.sh
|
||||
log_must rm -f ${ZEDLET_DIR}/all-debug.sh
|
||||
log_must rm -f ${ZEDLET_DIR}/zed.pid
|
||||
log_must rm -f ${ZEDLET_DIR}/zedlog
|
||||
log_must rm -f ${ZEDLET_DIR}/zed.debug.log
|
||||
log_must rm -f ${ZEDLET_DIR}/state
|
||||
log_must rm -f $ZED_LOG
|
||||
log_must rm -f $ZED_DEBUG_LOG
|
||||
log_must rm -f $VDEVID_CONF_ETC
|
||||
log_must rm -f $VDEVID_CONF
|
||||
rmdir $ZEDLET_DIR
|
||||
@@ -3412,9 +3414,10 @@ function zed_start
|
||||
|
||||
log_note "Starting ZED"
|
||||
# run ZED in the background and redirect foreground logging
|
||||
# output to zedlog
|
||||
# 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" \
|
||||
"-s $ZEDLET_DIR/state 2>${ZEDLET_DIR}/zedlog &"
|
||||
"-s $ZEDLET_DIR/state 2>$ZED_LOG &"
|
||||
|
||||
return 0
|
||||
}
|
||||
@@ -3431,7 +3434,9 @@ function zed_stop
|
||||
log_note "Stopping ZED"
|
||||
if [[ -f ${ZEDLET_DIR}/zed.pid ]]; then
|
||||
zedpid=$(cat ${ZEDLET_DIR}/zed.pid)
|
||||
log_must kill $zedpid
|
||||
kill $zedpid
|
||||
wait $zedpid
|
||||
rm -f ${ZEDLET_DIR}/zed.pid
|
||||
fi
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user