diff options
author | jkoshy <jkoshy@FreeBSD.org> | 2005-11-24 14:39:41 +0000 |
---|---|---|
committer | jkoshy <jkoshy@FreeBSD.org> | 2005-11-24 14:39:41 +0000 |
commit | ee7f1faad288d85d705ba10bfc0a7e63ca7b9ad5 (patch) | |
tree | c3fd0f016d814c084518ae199fe2bb3134f8825e /sbin/devd | |
parent | 607019b640127074bd45ccea99c37ccfb9ba5670 (diff) | |
download | FreeBSD-src-ee7f1faad288d85d705ba10bfc0a7e63ca7b9ad5.zip FreeBSD-src-ee7f1faad288d85d705ba10bfc0a7e63ca7b9ad5.tar.gz |
Add a -f configfile option to devd(8), based on a patch submitted by
Wojciech A. Koszek.
Submitted by: Wojciech A. Koszek <dunstan@freebsd.czest.pl>
Diffstat (limited to 'sbin/devd')
-rw-r--r-- | sbin/devd/devd.8 | 29 | ||||
-rw-r--r-- | sbin/devd/devd.cc | 9 |
2 files changed, 33 insertions, 5 deletions
diff --git a/sbin/devd/devd.8 b/sbin/devd/devd.8 index a3056eb..267e824 100644 --- a/sbin/devd/devd.8 +++ b/sbin/devd/devd.8 @@ -33,7 +33,9 @@ .Nd "device state change daemon" .Sh SYNOPSIS .Nm -.Op Fl Ddn +.Op Fl Dd +.Op Fl f Ar file +.Op Fl n .Sh DESCRIPTION The .Nm @@ -41,11 +43,19 @@ daemon provides a way to have userland programs run when certain kernel events happen. .Pp The following options are accepted. -.Bl -tag -width indent +.Bl -tag -width indent-two .It Fl D Enable debugging messages. .It Fl d Run in the foreground instead of becoming a daemon. +.It Fl f Ar file +Use configuration file +.Ar file +instead of the default +.Pa /etc/devd.conf . +If option +.Fl f +is specified more than once, the last file specified is used. .It Fl n Do not process all pending events before becoming a daemon. Instead, call daemon right away. @@ -95,7 +105,9 @@ The utility reads .Pa /etc/devd.conf -and uses that file to drive the rest of the process. +or the alternate configuration file specified with a +.Fl f +option and uses that file to drive the rest of the process. While the format of this file is described in .Xr devd.conf 5 , some basics are covered here. @@ -118,6 +130,17 @@ receives are forwarded to the .Ux domain socket at .Pa /var/run/devd.pipe . +.Sh FILES +.Bl -tag -width ".Pa /var/run/devd.pipe" -compact +.It Pa /etc/devd.conf +The default +.Nm +configuration file. +.It Pa /var/run/devd.pipe +The socket used by +.Nm +to communicate with its clients. +.El .Sh SEE ALSO .Xr devctl 4 , .Xr devd.conf 5 diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 3528736..c7b4e43 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -83,6 +83,8 @@ int dflag; int nflag; int romeo_must_die = 0; +static const char *configfile = CF; + static void event_loop(void); static void usage(void); @@ -353,7 +355,7 @@ config::parse(void) { vector<string>::const_iterator i; - parse_one_file(CF); + parse_one_file(configfile); for (i = _dir_list.begin(); i != _dir_list.end(); i++) parse_files_in_dir((*i).c_str()); sort_vector(_attach_list); @@ -908,7 +910,7 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "Ddn")) != -1) { + while ((ch = getopt(argc, argv, "Ddf:n")) != -1) { switch (ch) { case 'D': Dflag++; @@ -916,6 +918,9 @@ main(int argc, char **argv) case 'd': dflag++; break; + case 'f': + configfile = optarg; + break; case 'n': nflag++; break; |