2025-01-04 03:04:27 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.\" SPDX-License-Identifier: CDDL-1.0
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\"
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-09 06:10:13 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.\" This file is part of the ZFS Event Daemon (ZED).
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-03 22:21:21 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.\" Refer to the OpenZFS git commit log for authoritative copyright attribution.
							 | 
						
					
						
							
								
									
										
										
										
											2015-05-07 01:56:03 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.\"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" The contents of this file are subject to the terms of the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" Common Development and Distribution License Version 1.0 (CDDL-1.0).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" You can obtain a copy of the license from the top-level file
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\" You may not use this file except in compliance with the license.
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\"
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.\"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Dd May 26, 2021
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Dt ZED 8
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Os
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh NAME
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm ZED
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nd ZFS Event Daemon
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh SYNOPSIS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Op Fl fFhILMvVZ
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Op Fl d Ar zedletdir
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Op Fl p Ar pidfile
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Op Fl P Ar path
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Op Fl s Ar statefile
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Op Fl j Ar jobs
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-22 22:36:22 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Op Fl b Ar buflen
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh DESCRIPTION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								(ZFS Event Daemon) monitors events generated by the ZFS kernel
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								module.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								When a zevent (ZFS Event) is posted, the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								will run any ZEDLETs (ZFS Event Daemon Linkage for Executable Tasks)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								that have been enabled for the corresponding zevent class.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh OPTIONS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Bl -tag -width "-h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Fl h
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Display a summary of the command-line options.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl L
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Display license information.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl V
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Display version information.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl v
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Be verbose.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl f
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Force the daemon to run if at all possible, disabling security checks and
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								throwing caution to the wind.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Not recommended for use in production.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Fl F
							 | 
						
					
						
							
								
									
										
										
										
											2025-03-12 21:56:23 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Don't daemonize: remain attached to the controlling terminal,
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								log to the standard I/O streams.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Fl M
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Lock all current and future pages in the virtual memory address space.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This may help the daemon remain responsive when the system is under heavy
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								memory pressure.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl I
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-12 15:23:30 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Request that the daemon idle rather than exit when the kernel modules are not
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								loaded.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Processing of events will start, or resume, when the kernel modules are
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								(re)loaded.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Under Linux the kernel modules cannot be unloaded while the daemon is running.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Fl Z
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Zero the daemon's state, thereby allowing zevents still within the kernel
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								to be reprocessed.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl d Ar zedletdir
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Read the enabled ZEDLETs from the specified directory.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl p Ar pidfile
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Write the daemon's process ID to the specified file.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl P Ar path
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Custom
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Ev $PATH
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								for zedlets to use.
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-12 15:23:30 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Normally zedlets run in a locked-down environment, with hardcoded paths to the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ZFS commands
							 | 
						
					
						
							
								
									
										
										
										
											2022-03-24 22:14:25 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Pq Ev $ZFS , $ZPOOL , $ZED , … ,
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								and a hard-coded
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Ev $PATH .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This is done for security reasons.
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-12 15:23:30 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								However, the ZFS test suite uses a custom PATH for its ZFS commands, and passes
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								it to
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Nm
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								with
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Fl P .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								In short,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Fl P
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								is only to be used by the ZFS test suite; never use
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-23 22:38:05 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								it in production!
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl s Ar statefile
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Write the daemon's state to the specified file.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl j Ar jobs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Allow at most
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Ar jobs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ZEDLETs to run concurrently,
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-29 16:21:54 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								delaying execution of new ones until they finish.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Defaults to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy 16 .
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-22 22:36:22 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Fl b Ar buflen
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Cap kernel event buffer growth to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Ar buflen
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								entries.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This buffer is grown when the daemon misses an event, but results in
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								unreclaimable memory use in the kernel.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								A value of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy 0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								removes the cap.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Defaults to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy 1048576 .
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.El
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh ZEVENTS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								A zevent is comprised of a list of nvpairs (name/value pairs).
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-12 15:23:30 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Each zevent contains an EID (Event IDentifier) that uniquely identifies it
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								throughout
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								the lifetime of the loaded ZFS kernel module; this EID is a monotonically
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								increasing integer that resets to 1 each time the kernel module is loaded.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Each zevent also contains a class string that identifies the type of event.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								For brevity, a subclass string is defined that omits the leading components
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								of the class string.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Additional nvpairs exist to provide event details.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The kernel maintains a list of recent zevents that can be viewed (along with
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								their associated lists of nvpairs) using the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm zpool Cm events Fl v
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								command.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh CONFIGURATION
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ZEDLETs to be invoked in response to zevents are located in the
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Em enabled-zedlets
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								directory
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pq Ar zedletdir .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								These can be symlinked or copied from the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Em installed-zedlets
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								directory; symlinks allow for automatic updates
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								from the installed ZEDLETs, whereas copies preserve local modifications.
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-02 17:40:48 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								As a security measure, since ownership change is a privileged operation,
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ZEDLETs must be owned by root.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								They must have execute permissions for the user,
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-02 17:40:48 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								but they must not have write permissions for group or other.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Dotfiles are ignored.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ZEDLETs are named after the zevent class for which they should be invoked.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								In particular, a ZEDLET will be invoked for a given zevent if either its
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class or subclass string is a prefix of its filename (and is followed by
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								a non-alphabetic character).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								As a special case, the prefix
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy all
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								matches all zevents.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Multiple ZEDLETs may be invoked for a given zevent.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh ZEDLETS
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ZEDLETs are executables invoked by the ZED in response to a given zevent.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								They should be written under the presumption they can be invoked concurrently,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								and they should use appropriate locking to access any shared resources.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Common variables used by ZEDLETs can be stored in the default rc file which
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								is sourced by scripts; these variables should be prefixed with
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZED_ .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The zevent nvpairs are passed to ZEDLETs as environment variables.
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Each nvpair name is converted to an environment variable in the following
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								manner:
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-04 23:08:50 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Bl -enum -compact
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								it is prefixed with
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZEVENT_ ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								it is converted to uppercase, and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								each non-alphanumeric character is converted to an underscore.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.El
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Some additional environment variables have been defined to present certain
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								nvpair values in a more convenient form.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								An incomplete list of zevent environment variables is as follows:
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-04 23:08:50 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Bl -tag -compact -width "ZEVENT_TIME_STRING"
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_EID
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The Event IDentifier.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_CLASS
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The zevent class string.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_SUBCLASS
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The zevent subclass string.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_TIME
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The time at which the zevent was posted as
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Dq Em seconds nanoseconds
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								since the Epoch.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_TIME_SECS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Em seconds
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								component of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZEVENT_TIME .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_TIME_NSECS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Em nanoseconds
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								component of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZEVENT_TIME .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy ZEVENT_TIME_STRING
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								An almost-RFC3339-compliant string for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZEVENT_TIME .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.El
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Additionally, the following ZED & ZFS variables are defined:
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-04 23:08:50 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Bl -tag -compact -width "ZEVENT_TIME_STRING"
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy ZED_PID
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The daemon's process ID.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy ZED_ZEDLET_DIR
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The daemon's current
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Em enabled-zedlets
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								directory.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy ZFS_ALIAS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The alias
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pq Dq Em name Ns - Ns Em version Ns - Ns Em release
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								string of the ZFS distribution the daemon is part of.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy ZFS_VERSION
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The ZFS version the daemon is part of.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy ZFS_RELEASE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The ZFS release the daemon is part of.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.El
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ZEDLETs may need to call other ZFS commands.
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-12 15:23:30 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The installation paths of the following executables are defined as environment
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								variables:
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Sy ZDB ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZED ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZFS ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZINJECT ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sy ZPOOL .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								These variables may be overridden in the rc file.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh FILES
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Bl -tag -width "-c"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Pa @sysconfdir@/zfs/zed.d
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The default directory for enabled ZEDLETs.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Pa @sysconfdir@/zfs/zed.d/zed.rc
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The default rc file for common variables used by ZEDLETs.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Pa @zfsexecdir@/zed.d
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The default directory for installed ZEDLETs.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Pa @runstatedir@/zed.pid
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The default file containing the daemon's process ID.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Pa @runstatedir@/zed.state
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The default file containing the daemon's state.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.El
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh SIGNALS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Bl -tag -width "-c"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.It Sy SIGHUP
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.It Sy SIGTERM , SIGINT
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Terminate the daemon.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.El
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh SEE ALSO
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Xr zfs 8 ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Xr zpool 8 ,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Xr zpool-events 8
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh NOTES
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								requires root privileges.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Do not taunt the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Nm .
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								.Sh BUGS
							 | 
						
					
						
							
								
									
										
										
										
											2014-09-19 22:10:28 +04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ZEDLETs are unable to return state/status information to the kernel.
							 | 
						
					
						
							
								
									
										
										
										
											2021-05-26 19:29:29 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								.Pp
							 | 
						
					
						
							
								
									
										
										
										
											2014-01-22 01:30:03 +04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Internationalization support via gettext has not been added.
							 |