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.
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.
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]
22 # Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # ident "%Z%%M% %I% %E% SMI"
27 OLD_CONF
=/etc
/default
/syslogd
29 .
/lib
/svc
/share
/smf_include.sh
33 svccfg
-s svc
:/system
/system-log setprop config
/log_from_remote
= $1
35 svccfg
-s svc
:/system
/system-log addpg config application
36 svccfg
-s svc
:/system
/system-log \
37 addpropvalue config
/log_from_remote boolean
: $1
38 if [ $?
-ne 0 ] ; then
39 echo 'Failed to set remote syslog-logging'
40 exit $SMF_EXIT_ERR_CONFIG
43 echo "Incorporated ${OLD_CONF} settings into SMF. See syslogd(1m)."
45 if ($1 ~ /^LOG_FROM_REMOTE=/) {
46 print "# LOG_FROM_REMOTE is now set using "
47 "svccfg(1m), see syslog(1m).";
51 }' ${OLD_CONF} >${OLD_CONF}.new && cp ${OLD_CONF}.new ${OLD_CONF}
55 if [ ! -f /etc
/syslog.conf
]; then
56 echo "/etc/syslog.conf is missing. Exiting."
57 exit $SMF_EXIT_ERR_CONFIG
60 if [ ! -x /usr
/sbin
/syslogd
]; then
61 echo "Executable /usr/sbin/syslogd not found. Exiting"
62 exit $SMF_EXIT_ERR_CONFIG
65 if smf_is_globalzone
; then
67 # Before syslogd starts, save any messages from
68 # previous crash dumps so that messages appear
69 # in chronological order.
72 if [ -r /etc
/dumpadm.conf
]; then
74 [ -n "$DUMPADM_DEVICE" -a \
75 "x$DUMPADM_DEVICE" != xswap
] && \
76 /usr
/bin
/savecore
-m -f $DUMPADM_DEVICE
79 if [ ! -f /var
/adm
/messages
]; then
80 /usr
/bin
/cp /dev
/null
/var
/adm
/messages
81 /usr
/bin
/chmod 0644 /var
/adm
/messages
84 /^LOG_FROM_REMOTE=[yY][Ee][Ss]/ {print "true"}
85 /^LOG_FROM_REMOTE=[Nn][Oo]/ {print "false"}' < ${OLD_CONF}`
93 echo "Unsupported value in for LOG_FROM_REMOTE in ${OLD_CONF}"
94 exit $SMF_EXIT_ERR_CONFIG
98 /usr
/sbin
/syslogd
>/dev
/msglog
2>&1 &