4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license from the top-level
9 .\" OPENSOLARIS.LICENSE or <http://opensource.org/licenses/CDDL-1.0>.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each file
14 .\" and include the License file from the top-level OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
22 .\" Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
24 .TH ZED 8 "Octember 1, 2013" "ZFS on Linux" "System Administration Commands"
27 ZED \- ZFS Event Daemon
32 .\" [\fB\-c\fR \fIconfigfile\fR]
33 [\fB\-d\fR \fIzedletdir\fR]
39 [\fB\-p\fR \fIpidfile\fR]
40 [\fB\-s\fR \fIstatefile\fR]
47 \fBZED\fR (ZFS Event Daemon) monitors events generated by the ZFS kernel
48 module. When a zevent (ZFS Event) is posted, \fBZED\fR will run any ZEDLETs
49 (ZFS Event Daemon Linkage for Executable Tasks) that have been enabled for the
50 corresponding zevent class.
55 Display a summary of the command-line options.
58 Display license information.
61 Display version information.
67 Force the daemon to run if at all possible, disabling security checks and
68 throwing caution to the wind. Not recommended for use in production.
71 Run the daemon in the foreground.
74 Lock all current and future pages in the virtual memory address space.
75 This may help the daemon remain responsive when the system is under heavy
79 Zero the daemon's state, thereby allowing zevents still within the kernel
82 .\" .BI \-c\ configfile
83 .\" Read the configuration from the specified file.
86 Read the enabled ZEDLETs from the specified directory.
89 Write the daemon's process ID to the specified file.
92 Write the daemon's state to the specified file.
96 A zevent is comprised of a list of nvpairs (name/value pairs). Each zevent
97 contains an EID (Event IDentifier) that uniquely identifies it throughout
98 the lifetime of the loaded ZFS kernel module; this EID is a monotonically
99 increasing integer that resets to 1 each time the kernel module is loaded.
100 Each zevent also contains a class string that identifies the type of event.
101 For brevity, a subclass string is defined that omits the leading components
102 of the class string. Additional nvpairs exist to provide event details.
104 The kernel maintains a list of recent zevents that can be viewed (along with
105 their associated lists of nvpairs) using the "\fBzpool events \-v\fR" command.
109 ZEDLETs to be invoked in response to zevents are located in the
110 \fIenabled-zedlets\fR directory. These can be symlinked or copied from the
111 \fIinstalled-zedlets\fR directory; symlinks allow for automatic updates
112 from the installed ZEDLETs, whereas copies preserve local modifications.
113 As a security measure, ZEDLETs must be owned by root. They must have
114 execute permissions for the user, but they must not have write permissions
115 for group or other. Dotfiles are ignored.
117 ZEDLETs are named after the zevent class for which they should be invoked.
118 In particular, a ZEDLET will be invoked for a given zevent if either its
119 class or subclass string is a prefix of its filename (and is followed by
120 a non-alphabetic character). As a special case, the prefix "all" matches
121 all zevents. Multiple ZEDLETs may be invoked for a given zevent.
125 ZEDLETs are executables invoked by the ZED in response to a given zevent.
126 They should be written under the presumption they can be invoked concurrently,
127 and they should use appropriate locking to access any shared resources.
128 Common variables used by ZEDLETs can be stored in the default rc file which
129 is sourced by scripts; these variables should be prefixed with "ZED_".
131 The zevent nvpairs are passed to ZEDLETs as environment variables.
132 Each nvpair name is converted to an environment variable in the following
133 manner: 1) it is prefixed with "ZEVENT_", 2) it is converted to uppercase,
134 and 3) each non-alphanumeric character is converted to an underscore.
135 Some additional environment variables have been defined to present certain
136 nvpair values in a more convenient form. An incomplete list of zevent
137 environment variables is as follows:
141 The Event IDentifier.
145 The zevent class string.
149 The zevent subclass string.
153 The time at which the zevent was posted as
154 "\fIseconds\fR\ \fInanoseconds\fR" since the Epoch.
158 The \fIseconds\fR component of ZEVENT_TIME.
162 The \fInanoseconds\fR component of ZEVENT_TIME.
166 An almost-RFC3339-compliant string for ZEVENT_TIME.
168 Additionally, the following ZED & ZFS variables are defined:
172 The daemon's process ID.
176 The daemon's current \fIenabled-zedlets\fR directory.
180 The ZFS alias (\fIname-version-release\fR) string used to build the daemon.
184 The ZFS version used to build the daemon.
188 The ZFS release used to build the daemon.
190 ZEDLETs may need to call other ZFS commands. The installation paths of
191 the following executables are defined: \fBZDB\fR, \fBZED\fR, \fBZFS\fR,
192 \fBZINJECT\fR, and \fBZPOOL\fR. These variables can be overridden in the
197 .\" @sysconfdir@/zfs/zed.conf
198 .\" The default configuration file for the daemon.
200 .I @sysconfdir@/zfs/zed.d
201 The default directory for enabled ZEDLETs.
203 .I @sysconfdir@/zfs/zed.d/zed.rc
204 The default rc file for common variables used by ZEDLETs.
206 .I @libexecdir@/zfs/zed.d
207 The default directory for installed ZEDLETs.
209 .I @runstatedir@/zed.pid
210 The default file containing the daemon's process ID.
212 .I @runstatedir@/zed.state
213 The default file containing the daemon's state.
218 Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
221 Terminate the daemon.
225 \fBZED\fR requires root privileges.
226 .\" Do not taunt zed.
230 Events are processed synchronously by a single thread. This can delay the
231 processing of simultaneous zevents.
233 There is no maximum timeout for ZEDLET execution. Consequently, a misbehaving
234 ZEDLET can delay the processing of subsequent zevents.
236 The ownership and permissions of the \fIenabled-zedlets\fR directory (along
237 with all parent directories) are not checked. If any of these directories
238 are improperly owned or permissioned, an unprivileged user could insert a
239 ZEDLET to be executed as root. The requirement that ZEDLETs be owned by
240 root mitigates this to some extent.
242 ZEDLETs are unable to return state/status information to the kernel.
244 Some zevent nvpair types are not handled. These are denoted by zevent
245 environment variables having a "_NOT_IMPLEMENTED_" value.
247 Internationalization support via gettext has not been added.
249 The configuration file is not yet implemented.
251 The diagnosis engine is not yet implemented.
255 Developed at Lawrence Livermore National Laboratory (LLNL\-CODE\-403049).
257 Copyright (C) 2013\-2014 Lawrence Livermore National Security, LLC.
261 \fBZED\fR (ZFS Event Daemon) is distributed under the terms of the
262 Common Development and Distribution License (CDDL\-1.0).