Print this page
NEX-9586 remove nodename from the default savecore directory path
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dumpadm/dconf.c
          +++ new/usr/src/cmd/dumpadm/dconf.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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   * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
       23 + * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
  24   24   */
  25   25  
  26   26  #include <sys/types.h>
  27   27  #include <sys/stat.h>
  28   28  #include <sys/swap.h>
  29   29  #include <sys/dumpadm.h>
  30      -#include <sys/utsname.h>
  31   30  
  32   31  #include <unistd.h>
  33   32  #include <string.h>
  34   33  #include <stdlib.h>
  35   34  #include <stdio.h>
  36   35  #include <fcntl.h>
  37   36  #include <errno.h>
  38   37  #include <libdiskmgt.h>
  39   38  #include <libzfs.h>
  40   39  #include <uuid/uuid.h>
↓ open down ↓ 40 lines elided ↑ open up ↑
  81   80  /*
  82   81   * Permissions and ownership for the configuration file:
  83   82   */
  84   83  #define DC_OWNER        0                               /* Uid 0 (root) */
  85   84  #define DC_GROUP        1                               /* Gid 1 (other) */
  86   85  #define DC_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) /* Mode 0644 */
  87   86  
  88   87  static void
  89   88  dconf_init(dumpconf_t *dcp, int dcmode)
  90   89  {
  91      -        struct utsname ut;
  92      -
  93   90          /*
  94   91           * Default device for dumps is 'swap' (appropriate swap device),
  95      -         * and default savecore directory is /var/crash/`uname -n`,
       92 +         * and default savecore directory is /var/crash,
  96   93           * which is compatible with pre-dumpadm behavior.
  97   94           */
  98   95          (void) strcpy(dcp->dc_device, DC_STR_SWAP);
  99   96          (void) strcpy(dcp->dc_savdir, "/var/crash");
 100   97  
 101      -        if (uname(&ut) != -1) {
 102      -                (void) strcat(dcp->dc_savdir, "/");
 103      -                (void) strcat(dcp->dc_savdir, ut.nodename);
 104      -        }
 105      -
 106   98          /*
 107   99           * Default is contents kernel, savecore enabled on reboot,
 108  100           * savecore saves compressed core files.
 109  101           */
 110  102          dcp->dc_cflags = DUMP_KERNEL;
 111  103          dcp->dc_enable = DC_ON;
 112  104          dcp->dc_csave = DC_COMPRESSED;
 113  105  
 114  106          dcp->dc_mode = dcmode;
 115  107          dcp->dc_conf_fp = NULL;
↓ open down ↓ 597 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX