4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 #
25
26 . /lib/svc/share/smf_include.sh
27 . /lib/svc/share/fs_include.sh
28
29 #
30 # mksavedir
31 # Make sure that $DUMPADM_SAVDIR is set and exists.
32 #
33 mksavedir ()
34 {
35 [ -z "$DUMPADM_SAVDIR" ] && DUMPADM_SAVDIR=/var/crash/`uname -n`
36 [ -d "$DUMPADM_SAVDIR" ] || /usr/bin/mkdir -m 0700 -p $DUMPADM_SAVDIR
37 }
38
39 #
40 # We haven't run savecore on a dump device yet
41 #
42 savedev=none
43
44 #
45 # If we previously crashed early in boot before dumpadm was used to configure
46 # an alternate dump device, then the dump is in the primary swap partition,
47 # which was configured as the dump device by the first swapadd early in boot.
48 # Thus before we run dumpadm to configure the dump device, we first run
49 # savecore to check the swap partition for a dump; this is run in the
50 # foreground to reduce the chances of overwriting the dump.
51 #
52 # This does not apply for zfs root systems that use a zvol for dump;
53 # for such systems the dedicated dump device is appointed during startup
54 # of the filesystem/usr:default instance before any swap is added.
55 # Therefore we must check that the dump device is a swap device here -
|
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2017 Nexenta Systems, Inc. All rights reserved.
25 #
26
27 . /lib/svc/share/smf_include.sh
28 . /lib/svc/share/fs_include.sh
29
30 #
31 # mksavedir
32 # Make sure that $DUMPADM_SAVDIR is set and exists.
33 #
34 mksavedir ()
35 {
36 [ -z "$DUMPADM_SAVDIR" ] && DUMPADM_SAVDIR=/var/crash
37 [ -d "$DUMPADM_SAVDIR" ] || /usr/bin/mkdir -m 0700 -p $DUMPADM_SAVDIR
38 }
39
40 #
41 # We haven't run savecore on a dump device yet
42 #
43 savedev=none
44
45 #
46 # If we previously crashed early in boot before dumpadm was used to configure
47 # an alternate dump device, then the dump is in the primary swap partition,
48 # which was configured as the dump device by the first swapadd early in boot.
49 # Thus before we run dumpadm to configure the dump device, we first run
50 # savecore to check the swap partition for a dump; this is run in the
51 # foreground to reduce the chances of overwriting the dump.
52 #
53 # This does not apply for zfs root systems that use a zvol for dump;
54 # for such systems the dedicated dump device is appointed during startup
55 # of the filesystem/usr:default instance before any swap is added.
56 # Therefore we must check that the dump device is a swap device here -
|