Print this page
NEX-966 FM shouldn't spam system console
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fm/modules/common/syslog-msgs/syslog.c
          +++ new/usr/src/cmd/fm/modules/common/syslog-msgs/syslog.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
       28 + */
       29 +
  26   30  #include <sys/fm/protocol.h>
  27   31  #include <sys/strlog.h>
  28   32  #include <sys/log.h>
  29   33  #include <libscf.h>
  30   34  
  31   35  #include <fm/fmd_api.h>
  32   36  #include <fm/fmd_msg.h>
  33   37  
  34   38  #include <stropts.h>
  35   39  #include <strings.h>
↓ open down ↓ 270 lines elided ↑ open up ↑
 306  310              strcmp(class, FM_LIST_UPDATED_CLASS) == 0)
 307  311                  syslog_ctl.pri |= LOG_NOTICE;
 308  312          else
 309  313                  syslog_ctl.pri |= LOG_ERR;
 310  314  
 311  315          syslog_emit(hdl, msg);
 312  316          free(msg);
 313  317  }
 314  318  
 315  319  static const fmd_prop_t fmd_props[] = {
      320 +#ifdef DEBUG
 316  321          { "console", FMD_TYPE_BOOL, "true" },
      322 +#else
      323 +        { "console", FMD_TYPE_BOOL, "false" },
      324 +#endif
 317  325          { "facility", FMD_TYPE_STRING, "LOG_DAEMON" },
 318  326          { "gmt", FMD_TYPE_BOOL, "false" },
 319  327          { "syslogd", FMD_TYPE_BOOL, "true" },
 320  328          { "url", FMD_TYPE_STRING, "http://illumos.org/msg/" },
 321  329          { "message_all", FMD_TYPE_BOOL, "false" },
 322  330          { NULL, 0, NULL }
 323  331  };
 324  332  
 325  333  static const fmd_hdl_ops_t fmd_ops = {
 326  334          syslog_recv,    /* fmdo_recv */
↓ open down ↓ 97 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX