2 .\" This file is part of the ZFS Event Daemon (ZED)
3 .\" for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
4 .\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
5 .\" Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
6 .\" Refer to the ZoL git commit log for authoritative copyright attribution.
8 .\" The contents of this file are subject to the terms of the
9 .\" Common Development and Distribution License Version 1.0 (CDDL-1.0).
10 .\" You can obtain a copy of the license from the top-level file
11 .\" "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
12 .\" You may not use this file except in compliance with the license.
14 .TH ZED 8 "Octember 1, 2013" "ZFS on Linux" "System Administration Commands"
17 ZED \- ZFS Event Daemon
22 .\" [\fB\-c\fR \fIconfigfile\fR]
23 [\fB\-d\fR \fIzedletdir\fR]
29 [\fB\-p\fR \fIpidfile\fR]
30 [\fB\-s\fR \fIstatefile\fR]
37 \fBZED\fR (ZFS Event Daemon) monitors events generated by the ZFS kernel
38 module. When a zevent (ZFS Event) is posted, \fBZED\fR will run any ZEDLETs
39 (ZFS Event Daemon Linkage for Executable Tasks) that have been enabled for the
40 corresponding zevent class.
45 Display a summary of the command-line options.
48 Display license information.
51 Display version information.
57 Force the daemon to run if at all possible, disabling security checks and
58 throwing caution to the wind. Not recommended for use in production.
61 Run the daemon in the foreground.
64 Lock all current and future pages in the virtual memory address space.
65 This may help the daemon remain responsive when the system is under heavy
69 Zero the daemon's state, thereby allowing zevents still within the kernel
72 .\" .BI \-c\ configfile
73 .\" Read the configuration from the specified file.
76 Read the enabled ZEDLETs from the specified directory.
79 Write the daemon's process ID to the specified file.
82 Write the daemon's state to the specified file.
86 A zevent is comprised of a list of nvpairs (name/value pairs). Each zevent
87 contains an EID (Event IDentifier) that uniquely identifies it throughout
88 the lifetime of the loaded ZFS kernel module; this EID is a monotonically
89 increasing integer that resets to 1 each time the kernel module is loaded.
90 Each zevent also contains a class string that identifies the type of event.
91 For brevity, a subclass string is defined that omits the leading components
92 of the class string. Additional nvpairs exist to provide event details.
94 The kernel maintains a list of recent zevents that can be viewed (along with
95 their associated lists of nvpairs) using the "\fBzpool events \-v\fR" command.
99 ZEDLETs to be invoked in response to zevents are located in the
100 \fIenabled-zedlets\fR directory. These can be symlinked or copied from the
101 \fIinstalled-zedlets\fR directory; symlinks allow for automatic updates
102 from the installed ZEDLETs, whereas copies preserve local modifications.
103 As a security measure, ZEDLETs must be owned by root. They must have
104 execute permissions for the user, but they must not have write permissions
105 for group or other. Dotfiles are ignored.
107 ZEDLETs are named after the zevent class for which they should be invoked.
108 In particular, a ZEDLET will be invoked for a given zevent if either its
109 class or subclass string is a prefix of its filename (and is followed by
110 a non-alphabetic character). As a special case, the prefix "all" matches
111 all zevents. Multiple ZEDLETs may be invoked for a given zevent.
115 ZEDLETs are executables invoked by the ZED in response to a given zevent.
116 They should be written under the presumption they can be invoked concurrently,
117 and they should use appropriate locking to access any shared resources.
118 Common variables used by ZEDLETs can be stored in the default rc file which
119 is sourced by scripts; these variables should be prefixed with "ZED_".
121 The zevent nvpairs are passed to ZEDLETs as environment variables.
122 Each nvpair name is converted to an environment variable in the following
123 manner: 1) it is prefixed with "ZEVENT_", 2) it is converted to uppercase,
124 and 3) each non-alphanumeric character is converted to an underscore.
125 Some additional environment variables have been defined to present certain
126 nvpair values in a more convenient form. An incomplete list of zevent
127 environment variables is as follows:
131 The Event IDentifier.
135 The zevent class string.
139 The zevent subclass string.
143 The time at which the zevent was posted as
144 "\fIseconds\fR\ \fInanoseconds\fR" since the Epoch.
148 The \fIseconds\fR component of ZEVENT_TIME.
152 The \fInanoseconds\fR component of ZEVENT_TIME.
156 An almost-RFC3339-compliant string for ZEVENT_TIME.
158 Additionally, the following ZED & ZFS variables are defined:
162 The daemon's process ID.
166 The daemon's current \fIenabled-zedlets\fR directory.
170 The ZFS alias (\fIname-version-release\fR) string used to build the daemon.
174 The ZFS version used to build the daemon.
178 The ZFS release used to build the daemon.
180 ZEDLETs may need to call other ZFS commands. The installation paths of
181 the following executables are defined: \fBZDB\fR, \fBZED\fR, \fBZFS\fR,
182 \fBZINJECT\fR, and \fBZPOOL\fR. These variables can be overridden in the
187 .\" @sysconfdir@/zfs/zed.conf
188 .\" The default configuration file for the daemon.
190 .I @sysconfdir@/zfs/zed.d
191 The default directory for enabled ZEDLETs.
193 .I @sysconfdir@/zfs/zed.d/zed.rc
194 The default rc file for common variables used by ZEDLETs.
196 .I @libexecdir@/zfs/zed.d
197 The default directory for installed ZEDLETs.
199 .I @runstatedir@/zed.pid
200 The default file containing the daemon's process ID.
202 .I @runstatedir@/zed.state
203 The default file containing the daemon's state.
208 Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
211 Terminate the daemon.
215 \fBZED\fR requires root privileges.
216 .\" Do not taunt zed.
220 Events are processed synchronously by a single thread. This can delay the
221 processing of simultaneous zevents.
223 There is no maximum timeout for ZEDLET execution. Consequently, a misbehaving
224 ZEDLET can delay the processing of subsequent zevents.
226 The ownership and permissions of the \fIenabled-zedlets\fR directory (along
227 with all parent directories) are not checked. If any of these directories
228 are improperly owned or permissioned, an unprivileged user could insert a
229 ZEDLET to be executed as root. The requirement that ZEDLETs be owned by
230 root mitigates this to some extent.
232 ZEDLETs are unable to return state/status information to the kernel.
234 Some zevent nvpair types are not handled. These are denoted by zevent
235 environment variables having a "_NOT_IMPLEMENTED_" value.
237 Internationalization support via gettext has not been added.
239 The configuration file is not yet implemented.
241 The diagnosis engine is not yet implemented.
245 \fBZED\fR (ZFS Event Daemon) is distributed under the terms of the
246 Common Development and Distribution License Version 1.0 (CDDL\-1.0).
248 Developed at Lawrence Livermore National Laboratory (LLNL\-CODE\-403049).