]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man8/zed.8.in
Imported Upstream version 0.6.4.2
[mirror_zfs-debian.git] / man / man8 / zed.8.in
CommitLineData
ea04106b
AX
1.\"
2.\" CDDL HEADER START
3.\"
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.
7.\"
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.
12.\"
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]
18.\"
19.\" CDDL HEADER END
20.\"
21.\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
22.\" Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
23.\"
24.TH ZED 8 "Octember 1, 2013" "ZFS on Linux" "System Administration Commands"
25
26.SH NAME
27ZED \- ZFS Event Daemon
28
29.SH SYNOPSIS
30.HP
31.B zed
32.\" [\fB\-c\fR \fIconfigfile\fR]
33[\fB\-d\fR \fIzedletdir\fR]
34[\fB\-f\fR]
35[\fB\-F\fR]
36[\fB\-h\fR]
37[\fB\-L\fR]
38[\fB\-M\fR]
39[\fB\-p\fR \fIpidfile\fR]
40[\fB\-s\fR \fIstatefile\fR]
41[\fB\-v\fR]
42[\fB\-V\fR]
43[\fB\-Z\fR]
44
45.SH DESCRIPTION
46.PP
47\fBZED\fR (ZFS Event Daemon) monitors events generated by the ZFS kernel
48module. 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
50corresponding zevent class.
51
52.SH OPTIONS
53.TP
54.BI \-h
55Display a summary of the command-line options.
56.TP
57.BI \-L
58Display license information.
59.TP
60.BI \-V
61Display version information.
62.TP
63.BI \-v
64Be verbose.
65.TP
66.BI \-f
67Force the daemon to run if at all possible, disabling security checks and
68throwing caution to the wind. Not recommended for use in production.
69.TP
70.BI \-F
71Run the daemon in the foreground.
72.TP
73.BI \-M
74Lock all current and future pages in the virtual memory address space.
75This may help the daemon remain responsive when the system is under heavy
76memory pressure.
77.TP
78.BI \-Z
79Zero the daemon's state, thereby allowing zevents still within the kernel
80to be reprocessed.
81.\" .TP
82.\" .BI \-c\ configfile
83.\" Read the configuration from the specified file.
84.TP
85.BI \-d\ zedletdir
86Read the enabled ZEDLETs from the specified directory.
87.TP
88.BI \-p\ pidfile
89Write the daemon's process ID to the specified file.
90.TP
91.BI \-s\ statefile
92Write the daemon's state to the specified file.
93
94.SH ZEVENTS
95.PP
96A zevent is comprised of a list of nvpairs (name/value pairs). Each zevent
97contains an EID (Event IDentifier) that uniquely identifies it throughout
98the lifetime of the loaded ZFS kernel module; this EID is a monotonically
99increasing integer that resets to 1 each time the kernel module is loaded.
100Each zevent also contains a class string that identifies the type of event.
101For brevity, a subclass string is defined that omits the leading components
102of the class string. Additional nvpairs exist to provide event details.
103.PP
104The kernel maintains a list of recent zevents that can be viewed (along with
105their associated lists of nvpairs) using the "\fBzpool events \-v\fR" command.
106
107.SH CONFIGURATION
108.PP
109ZEDLETs 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
112from the installed ZEDLETs, whereas copies preserve local modifications.
113As a security measure, ZEDLETs must be owned by root. They must have
114execute permissions for the user, but they must not have write permissions
115for group or other. Dotfiles are ignored.
116.PP
117ZEDLETs are named after the zevent class for which they should be invoked.
118In particular, a ZEDLET will be invoked for a given zevent if either its
119class or subclass string is a prefix of its filename (and is followed by
120a non-alphabetic character). As a special case, the prefix "all" matches
121all zevents. Multiple ZEDLETs may be invoked for a given zevent.
122
123.SH ZEDLETS
124.PP
125ZEDLETs are executables invoked by the ZED in response to a given zevent.
126They should be written under the presumption they can be invoked concurrently,
127and they should use appropriate locking to access any shared resources.
128Common variables used by ZEDLETs can be stored in the default rc file which
129is sourced by scripts; these variables should be prefixed with "ZED_".
130.PP
131The zevent nvpairs are passed to ZEDLETs as environment variables.
132Each nvpair name is converted to an environment variable in the following
133manner: 1) it is prefixed with "ZEVENT_", 2) it is converted to uppercase,
134and 3) each non-alphanumeric character is converted to an underscore.
135Some additional environment variables have been defined to present certain
136nvpair values in a more convenient form. An incomplete list of zevent
137environment variables is as follows:
138.TP
139.B
140ZEVENT_EID
141The Event IDentifier.
142.TP
143.B
144ZEVENT_CLASS
145The zevent class string.
146.TP
147.B
148ZEVENT_SUBCLASS
149The zevent subclass string.
150.TP
151.B
152ZEVENT_TIME
153The time at which the zevent was posted as
154"\fIseconds\fR\ \fInanoseconds\fR" since the Epoch.
155.TP
156.B
157ZEVENT_TIME_SECS
158The \fIseconds\fR component of ZEVENT_TIME.
159.TP
160.B
161ZEVENT_TIME_NSECS
162The \fInanoseconds\fR component of ZEVENT_TIME.
163.TP
164.B
165ZEVENT_TIME_STRING
166An almost-RFC3339-compliant string for ZEVENT_TIME.
167.PP
168Additionally, the following ZED & ZFS variables are defined:
169.TP
170.B
171ZED_PID
172The daemon's process ID.
173.TP
174.B
175ZED_ZEDLET_DIR
176The daemon's current \fIenabled-zedlets\fR directory.
177.TP
178.B
179ZFS_ALIAS
180The ZFS alias (\fIname-version-release\fR) string used to build the daemon.
181.TP
182.B
183ZFS_VERSION
184The ZFS version used to build the daemon.
185.TP
186.B
187ZFS_RELEASE
188The ZFS release used to build the daemon.
189.PP
190ZEDLETs may need to call other ZFS commands. The installation paths of
191the following executables are defined: \fBZDB\fR, \fBZED\fR, \fBZFS\fR,
192\fBZINJECT\fR, and \fBZPOOL\fR. These variables can be overridden in the
193rc file if needed.
194
195.SH FILES
196.\" .TP
197.\" @sysconfdir@/zfs/zed.conf
198.\" The default configuration file for the daemon.
199.TP
200.I @sysconfdir@/zfs/zed.d
201The default directory for enabled ZEDLETs.
202.TP
203.I @sysconfdir@/zfs/zed.d/zed.rc
204The default rc file for common variables used by ZEDLETs.
205.TP
206.I @libexecdir@/zfs/zed.d
207The default directory for installed ZEDLETs.
208.TP
209.I @runstatedir@/zed.pid
210The default file containing the daemon's process ID.
211.TP
212.I @runstatedir@/zed.state
213The default file containing the daemon's state.
214
215.SH SIGNALS
216.TP
217.B HUP
218Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
219.TP
220.B TERM
221Terminate the daemon.
222
223.SH NOTES
224.PP
225\fBZED\fR requires root privileges.
226.\" Do not taunt zed.
227
228.SH BUGS
229.PP
230Events are processed synchronously by a single thread. This can delay the
231processing of simultaneous zevents.
232.PP
233There is no maximum timeout for ZEDLET execution. Consequently, a misbehaving
234ZEDLET can delay the processing of subsequent zevents.
235.PP
236The ownership and permissions of the \fIenabled-zedlets\fR directory (along
237with all parent directories) are not checked. If any of these directories
238are improperly owned or permissioned, an unprivileged user could insert a
239ZEDLET to be executed as root. The requirement that ZEDLETs be owned by
240root mitigates this to some extent.
241.PP
242ZEDLETs are unable to return state/status information to the kernel.
243.PP
244Some zevent nvpair types are not handled. These are denoted by zevent
245environment variables having a "_NOT_IMPLEMENTED_" value.
246.PP
247Internationalization support via gettext has not been added.
248.PP
249The configuration file is not yet implemented.
250.PP
251The diagnosis engine is not yet implemented.
252
253.SH COPYRIGHT
254.PP
255Developed at Lawrence Livermore National Laboratory (LLNL\-CODE\-403049).
256.br
257Copyright (C) 2013\-2014 Lawrence Livermore National Security, LLC.
258
259.SH LICENSE
260.PP
261\fBZED\fR (ZFS Event Daemon) is distributed under the terms of the
262Common Development and Distribution License (CDDL\-1.0).
263
264.SH SEE ALSO
265.BR zfs (8),
266.BR zpool (8)