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)
35 (ZFS Event Daemon) monitors events generated by the ZFS kernel
37 When a zevent (ZFS Event) is posted, the
39 will run any ZEDLETs (ZFS Event Daemon Linkage for Executable Tasks)
40 that have been enabled for the corresponding zevent class.
45 Display a summary of the command-line options.
47 Display license information.
49 Display version information.
53 Force the daemon to run if at all possible, disabling security checks and
54 throwing caution to the wind.
55 Not recommended for use in production.
57 Don't daemonise: remain attached to the controlling terminal,
58 log to the standard I/O streams.
60 Lock all current and future pages in the virtual memory address space.
61 This may help the daemon remain responsive when the system is under heavy
64 Request that the daemon idle rather than exit when the kernel modules are not
66 Processing of events will start, or resume, when the kernel modules are
68 Under Linux the kernel modules cannot be unloaded while the daemon is running.
70 Zero the daemon's state, thereby allowing zevents still within the kernel
73 Read the enabled ZEDLETs from the specified directory.
75 Write the daemon's process ID to the specified file.
80 Normally zedlets run in a locked-down environment, with hardcoded paths to the
82 .Pq Ev $ZFS , $ZPOOL , $ZED , … ,
85 This is done for security reasons.
86 However, the ZFS test suite uses a custom PATH for its ZFS commands, and passes
93 is only to be used by the ZFS test suite; never use
96 Write the daemon's state to the specified file.
100 ZEDLETs to run concurrently,
101 delaying execution of new ones until they finish.
105 Cap kernel event buffer growth to
108 This buffer is grown when the daemon misses an event, but results in
109 unreclaimable memory use in the kernel.
117 A zevent is comprised of a list of nvpairs (name/value pairs).
118 Each zevent contains an EID (Event IDentifier) that uniquely identifies it
120 the lifetime of the loaded ZFS kernel module; this EID is a monotonically
121 increasing integer that resets to 1 each time the kernel module is loaded.
122 Each zevent also contains a class string that identifies the type of event.
123 For brevity, a subclass string is defined that omits the leading components
125 Additional nvpairs exist to provide event details.
127 The kernel maintains a list of recent zevents that can be viewed (along with
128 their associated lists of nvpairs) using the
129 .Nm zpool Cm events Fl v
133 ZEDLETs to be invoked in response to zevents are located in the
137 These can be symlinked or copied from the
138 .Em installed-zedlets
139 directory; symlinks allow for automatic updates
140 from the installed ZEDLETs, whereas copies preserve local modifications.
141 As a security measure, since ownership change is a privileged operation,
142 ZEDLETs must be owned by root.
143 They must have execute permissions for the user,
144 but they must not have write permissions for group or other.
145 Dotfiles are ignored.
147 ZEDLETs are named after the zevent class for which they should be invoked.
148 In particular, a ZEDLET will be invoked for a given zevent if either its
149 class or subclass string is a prefix of its filename (and is followed by
150 a non-alphabetic character).
151 As a special case, the prefix
154 Multiple ZEDLETs may be invoked for a given zevent.
157 ZEDLETs are executables invoked by the ZED in response to a given zevent.
158 They should be written under the presumption they can be invoked concurrently,
159 and they should use appropriate locking to access any shared resources.
160 Common variables used by ZEDLETs can be stored in the default rc file which
161 is sourced by scripts; these variables should be prefixed with
164 The zevent nvpairs are passed to ZEDLETs as environment variables.
165 Each nvpair name is converted to an environment variable in the following
172 it is converted to uppercase, and
174 each non-alphanumeric character is converted to an underscore.
177 Some additional environment variables have been defined to present certain
178 nvpair values in a more convenient form.
179 An incomplete list of zevent environment variables is as follows:
180 .Bl -tag -compact -width "ZEVENT_TIME_STRING"
182 The Event IDentifier.
184 The zevent class string.
185 .It Sy ZEVENT_SUBCLASS
186 The zevent subclass string.
188 The time at which the zevent was posted as
189 .Dq Em seconds nanoseconds
191 .It Sy ZEVENT_TIME_SECS
196 .It Sy ZEVENT_TIME_NSECS
201 .It Sy ZEVENT_TIME_STRING
202 An almost-RFC3339-compliant string for
206 Additionally, the following ZED & ZFS variables are defined:
207 .Bl -tag -compact -width "ZEVENT_TIME_STRING"
209 The daemon's process ID.
210 .It Sy ZED_ZEDLET_DIR
216 .Pq Dq Em name Ns - Ns Em version Ns - Ns Em release
217 string of the ZFS distribution the daemon is part of.
219 The ZFS version the daemon is part of.
221 The ZFS release the daemon is part of.
224 ZEDLETs may need to call other ZFS commands.
225 The installation paths of the following executables are defined as environment
233 These variables may be overridden in the rc file.
237 .It Pa @sysconfdir@/zfs/zed.d
238 The default directory for enabled ZEDLETs.
239 .It Pa @sysconfdir@/zfs/zed.d/zed.rc
240 The default rc file for common variables used by ZEDLETs.
241 .It Pa @zfsexecdir@/zed.d
242 The default directory for installed ZEDLETs.
243 .It Pa @runstatedir@/zed.pid
244 The default file containing the daemon's process ID.
245 .It Pa @runstatedir@/zed.state
246 The default file containing the daemon's state.
252 Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
253 .It Sy SIGTERM , SIGINT
254 Terminate the daemon.
265 requires root privileges.
271 ZEDLETs are unable to return state/status information to the kernel.
273 Internationalization support via gettext has not been added.