[PATCH] Support for different config file in sensorsd(8)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Support for different config file in sensorsd(8)

Dmitri Alenitchev
Hello.
This patch just useful for me. ;-)
Here also added `d' option to man-page.

Index: sensorsd.8
===================================================================
RCS file: /cvs/src/usr.sbin/sensorsd/sensorsd.8,v
retrieving revision 1.9
diff -u -r1.9 sensorsd.8
--- sensorsd.8 21 Apr 2006 08:35:00 -0000 1.9
+++ sensorsd.8 30 Aug 2006 00:55:45 -0000
@@ -23,6 +23,9 @@
 .Nd monitor hardware sensors
 .Sh SYNOPSIS
 .Nm sensorsd
+.Bk -words
+.Op Fl d
+.Op Fl f Ar config_file
 .Sh DESCRIPTION
 The
 .Nm
@@ -34,6 +37,17 @@
 If the data is out of given limits, an alert is sent using
 .Xr syslog 3
 and a command, if specified, is executed.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl d
+Enable debugging to the standard output,
+and do not disassociate from the controlling terminal.
+.It Fl f Ar config_file
+Specify the pathname of an alternate configuration file;
+the default is
+.Pa /etc/sensorsd.conf .
+.El
 .Pp
 Limit and command values for a particular sensor may be specified in the
 .Xr sensorsd.conf 5
Index: sensorsd.c
===================================================================
RCS file: /cvs/src/usr.sbin/sensorsd/sensorsd.c,v
retrieving revision 1.23
diff -u -r1.23 sensorsd.c
--- sensorsd.c 23 Aug 2006 11:18:00 -0000 1.23
+++ sensorsd.c 30 Aug 2006 00:55:45 -0000
@@ -68,7 +68,7 @@
 usage(void)
 {
  extern char *__progname;
- fprintf(stderr, "usage: %s [-d]\n", __progname);
+ fprintf(stderr, "usage: %s [-d] [-f config_file]\n", __progname);
  exit(1);
 }
 
@@ -81,10 +81,13 @@
  time_t next_report, last_report = 0, next_check;
  int mib[3], i, sleeptime, sensor_cnt, watch_cnt, ch;
 
- while ((ch = getopt(argc, argv, "d")) != -1) {
+ while ((ch = getopt(argc, argv, "df:")) != -1) {
  switch (ch) {
  case 'd':
  debug = 1;
+ break;
+ case 'f':
+ configfile = optarg;
  break;
  default:
  usage();

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Support for different config file in sensorsd(8)

Sam Chill
On 8/29/06, Dmitri Alenitchev <[hidden email]> wrote:
> Hello.
> This patch just useful for me. ;-)
> Here also added `d' option to man-page.
I submitted a very similar patch several months back and it wasn't
committed because sensorsd will be rewritten and nobody wants to add
much functionality to the current one.
-Sam

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Support for different config file in sensorsd(8)

Dmitri Alenitchev
Sam Chill wrote:
> On 8/29/06, Dmitri Alenitchev <[hidden email]> wrote:
> >Hello.
> >This patch just useful for me. ;-)
> >Here also added `d' option to man-page.
> I submitted a very similar patch several months back and it wasn't
> committed because sensorsd will be rewritten and nobody wants to add
> much functionality to the current one.
> -Sam

Really. I pass it.