2 .\" This file is part of the ZFS Event Daemon (ZED).
3 .\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
4 .\" Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
5 .\" Refer to the OpenZFS git commit log for authoritative copyright attribution.
7 .\" The contents of this file are subject to the terms of the
8 .\" Common Development and Distribution License Version 1.0 (CDDL-1.0).
9 .\" You can obtain a copy of the license from the top-level file
10 .\" "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
11 .\" You may not use this file except in compliance with the license.
13 .\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049)
34 (ZFS Event Daemon) monitors events generated by the ZFS kernel
36 When a zevent (ZFS Event) is posted, the
38 will run any ZEDLETs (ZFS Event Daemon Linkage for Executable Tasks)
39 that have been enabled for the corresponding zevent class.
44 Display a summary of the command-line options.
46 Display license information.
48 Display version information.
52 Force the daemon to run if at all possible, disabling security checks and
53 throwing caution to the wind.
54 Not recommended for use in production.
56 Don't daemonise: remain attached to the controlling terminal,
57 log to the standard I/O streams.
59 Lock all current and future pages in the virtual memory address space.
60 This may help the daemon remain responsive when the system is under heavy
63 Request that the daemon idle rather than exit when the kernel modules are not loaded.
64 Processing of events will start, or resume, when the kernel modules are (re)loaded.
65 Under Linux the kernel modules cannot be unloaded while the daemon is running.
67 Zero the daemon's state, thereby allowing zevents still within the kernel
70 Read the enabled ZEDLETs from the specified directory.
72 Write the daemon's process ID to the specified file.
77 Normally zedlets run in a locked-down environment, with hardcoded paths to the ZFS commands
78 .Pq Ev $ZFS , $ZPOOL , $ZED , ... ,
81 This is done for security reasons.
82 However, the ZFS test suite uses a custom PATH for its ZFS commands, and passes it to
88 is only to be used by the ZFS test suite; never use
91 Write the daemon's state to the specified file.
95 ZEDLETs to run concurrently,
96 delaying execution of new ones until they finish.
101 A zevent is comprised of a list of nvpairs (name/value pairs).
102 Each zevent contains an EID (Event IDentifier) that uniquely identifies it throughout
103 the lifetime of the loaded ZFS kernel module; this EID is a monotonically
104 increasing integer that resets to 1 each time the kernel module is loaded.
105 Each zevent also contains a class string that identifies the type of event.
106 For brevity, a subclass string is defined that omits the leading components
108 Additional nvpairs exist to provide event details.
110 The kernel maintains a list of recent zevents that can be viewed (along with
111 their associated lists of nvpairs) using the
112 .Nm zpool Cm events Fl v
116 ZEDLETs to be invoked in response to zevents are located in the
120 These can be symlinked or copied from the
121 .Em installed-zedlets
122 directory; symlinks allow for automatic updates
123 from the installed ZEDLETs, whereas copies preserve local modifications.
124 As a security measure, since ownership change is a privileged operation,
125 ZEDLETs must be owned by root.
126 They must have execute permissions for the user,
127 but they must not have write permissions for group or other.
128 Dotfiles are ignored.
130 ZEDLETs are named after the zevent class for which they should be invoked.
131 In particular, a ZEDLET will be invoked for a given zevent if either its
132 class or subclass string is a prefix of its filename (and is followed by
133 a non-alphabetic character).
134 As a special case, the prefix
137 Multiple ZEDLETs may be invoked for a given zevent.
140 ZEDLETs are executables invoked by the ZED in response to a given zevent.
141 They should be written under the presumption they can be invoked concurrently,
142 and they should use appropriate locking to access any shared resources.
143 Common variables used by ZEDLETs can be stored in the default rc file which
144 is sourced by scripts; these variables should be prefixed with
147 The zevent nvpairs are passed to ZEDLETs as environment variables.
148 Each nvpair name is converted to an environment variable in the following
155 it is converted to uppercase, and
157 each non-alphanumeric character is converted to an underscore.
160 Some additional environment variables have been defined to present certain
161 nvpair values in a more convenient form.
162 An incomplete list of zevent environment variables is as follows:
163 .Bl -tag -width "ZEVENT_TIME_STRING"
165 The Event IDentifier.
167 The zevent class string.
168 .It Sy ZEVENT_SUBCLASS
169 The zevent subclass string.
171 The time at which the zevent was posted as
172 .Dq Em seconds nanoseconds
174 .It Sy ZEVENT_TIME_SECS
179 .It Sy ZEVENT_TIME_NSECS
184 .It Sy ZEVENT_TIME_STRING
185 An almost-RFC3339-compliant string for
189 Additionally, the following ZED & ZFS variables are defined:
190 .Bl -tag -width "ZEVENT_TIME_STRING"
192 The daemon's process ID.
193 .It Sy ZED_ZEDLET_DIR
199 .Pq Dq Em name Ns - Ns Em version Ns - Ns Em release
200 string of the ZFS distribution the daemon is part of.
202 The ZFS version the daemon is part of.
204 The ZFS release the daemon is part of.
207 ZEDLETs may need to call other ZFS commands.
208 The installation paths of the following executables are defined as environment variables:
215 These variables may be overridden in the rc file.
219 .It Pa @sysconfdir@/zfs/zed.d
220 The default directory for enabled ZEDLETs.
221 .It Pa @sysconfdir@/zfs/zed.d/zed.rc
222 The default rc file for common variables used by ZEDLETs.
223 .It Pa @zfsexecdir@/zed.d
224 The default directory for installed ZEDLETs.
225 .It Pa @runstatedir@/zed.pid
226 The default file containing the daemon's process ID.
227 .It Pa @runstatedir@/zed.state
228 The default file containing the daemon's state.
234 Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
235 .It Sy SIGTERM , SIGINT
236 Terminate the daemon.
247 requires root privileges.
253 ZEDLETs are unable to return state/status information to the kernel.
255 Internationalization support via gettext has not been added.