diff options
| author | eschrock <none@none> | 2006-02-22 18:19:30 -0800 |
|---|---|---|
| committer | eschrock <none@none> | 2006-02-22 18:19:30 -0800 |
| commit | 7950274e5799b56695a76f974ac361411ec2e515 (patch) | |
| tree | a939e6661c651f0d011970a75a288e182e4f1c85 /usr/src | |
| parent | fb27b1cde16b9960f54ab0b90d03c71f2866b393 (diff) | |
| download | illumos-joyent-7950274e5799b56695a76f974ac361411ec2e515.tar.gz | |
5004701 svc-savecore should be quieter about swap devices with no dump support
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/dumpadm/svc-dumpadm | 10 | ||||
| -rw-r--r-- | usr/src/cmd/savecore/savecore.c | 23 |
2 files changed, 21 insertions, 12 deletions
diff --git a/usr/src/cmd/dumpadm/svc-dumpadm b/usr/src/cmd/dumpadm/svc-dumpadm index f5571b7285..022bbab3b7 100644 --- a/usr/src/cmd/dumpadm/svc-dumpadm +++ b/usr/src/cmd/dumpadm/svc-dumpadm @@ -3,9 +3,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -21,7 +20,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -88,7 +87,8 @@ fi # saved the dump, savecore will just exit immediately. # if [ "x$DUMPADM_ENABLE" != xno ]; then - if /usr/sbin/swap -l | grep "^${DUMPADM_DEVICE} " >/dev/null 2>&1; then + if /usr/sbin/swap -l 2>/dev/null | grep "^${DUMPADM_DEVICE} " \ + >/dev/null 2>&1; then # # If the dump device is part of swap, we only need to run # savecore a second time if the device is different from the diff --git a/usr/src/cmd/savecore/savecore.c b/usr/src/cmd/savecore/savecore.c index d047d01871..da8d6ee441 100644 --- a/usr/src/cmd/savecore/savecore.c +++ b/usr/src/cmd/savecore/savecore.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1998-2002 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -450,8 +449,18 @@ main(int argc, char *argv[]) if (dumpfile == NULL) { dumpfile = Zalloc(MAXPATHLEN); - if (ioctl(dumpfd, DIOCGETDEV, dumpfile) == -1) - logprint(LOG_ERR, 1, 1, "no dump device configured"); + if (ioctl(dumpfd, DIOCGETDEV, dumpfile) == -1) { + /* + * If this isn't an interactive session, we are running + * as part of the boot process. If this is the case, + * don't complain about the lack of dump device. + */ + if (isatty(STDOUT_FILENO)) + logprint(LOG_ERR, 1, 1, + "no dump device configured"); + else + return (1); + } } if (mflag) |
