diff options
author | Chris Dunlap <[email protected]> | 2014-09-19 11:10:28 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-09-25 13:54:17 -0700 |
commit | dcca723acee9803561dd7ef456a28c4684c28e86 (patch) | |
tree | 082e642033d282e30adf72f07b0678083009cd0d /cmd/zed/zed_exec.c | |
parent | 8cb8cf91df8a4902025d814b62b9332ad1b291c7 (diff) |
Refer to ZED's scripts as ZEDLETs
The executables invoked by the ZED in response to a given zevent
have been generically referred to as "scripts". By convention,
these scripts have aimed to be /bin/sh compatible for reasons of
portability and comprehensibility. However, the ZED only requires
they be executable and (ideally) capable of reading environment
variables. As such, these scripts are now referred to as ZEDLETs
(ZFS Event Daemon Linkage for Executable Tasks).
Signed-off-by: Chris Dunlap <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2735
Diffstat (limited to 'cmd/zed/zed_exec.c')
-rw-r--r-- | cmd/zed/zed_exec.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cmd/zed/zed_exec.c b/cmd/zed/zed_exec.c index 19fc30b59..d4193219f 100644 --- a/cmd/zed/zed_exec.c +++ b/cmd/zed/zed_exec.c @@ -156,13 +156,13 @@ restart: } /* - * Process the event [eid] by synchronously invoking all scripts with a + * Process the event [eid] by synchronously invoking all zedlets with a * matching class prefix. * - * Each executable in [scripts] from the directory [dir] is matched against + * Each executable in [zedlets] from the directory [dir] is matched against * the event's [class], [subclass], and the "all" class (which matches - * all events). Every script with a matching class prefix is invoked. - * The NAME=VALUE strings in [envs] will be passed to the script as + * all events). Every zedlet with a matching class prefix is invoked. + * The NAME=VALUE strings in [envs] will be passed to the zedlet as * environment variables. * * The file descriptor [zfd] is the zevent_fd used to track the @@ -172,16 +172,16 @@ restart: */ int zed_exec_process(uint64_t eid, const char *class, const char *subclass, - const char *dir, zed_strings_t *scripts, zed_strings_t *envs, int zfd) + const char *dir, zed_strings_t *zedlets, zed_strings_t *envs, int zfd) { const char *class_strings[4]; const char *allclass = "all"; const char **csp; - const char *s; + const char *z; char **e; int n; - if (!dir || !scripts || !envs || zfd < 0) + if (!dir || !zedlets || !envs || zfd < 0) return (-1); csp = class_strings; @@ -199,11 +199,11 @@ zed_exec_process(uint64_t eid, const char *class, const char *subclass, e = _zed_exec_create_env(envs); - for (s = zed_strings_first(scripts); s; s = zed_strings_next(scripts)) { + for (z = zed_strings_first(zedlets); z; z = zed_strings_next(zedlets)) { for (csp = class_strings; *csp; csp++) { n = strlen(*csp); - if ((strncmp(s, *csp, n) == 0) && !isalpha(s[n])) - _zed_exec_fork_child(eid, dir, s, e, zfd); + if ((strncmp(z, *csp, n) == 0) && !isalpha(z[n])) + _zed_exec_fork_child(eid, dir, z, e, zfd); } } free(e); |