svc-auditd revision 6927f468b0af7710df000f6b16f6ee413e1e3007
1096N/A#! /sbin/sh
2362N/A#
1096N/A# CDDL HEADER START
1096N/A#
1096N/A# The contents of this file are subject to the terms of the
1096N/A# Common Development and Distribution License (the "License").
2362N/A# You may not use this file except in compliance with the License.
1096N/A#
2362N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1096N/A# or http://www.opensolaris.org/os/licensing.
1096N/A# See the License for the specific language governing permissions
1096N/A# and limitations under the License.
1096N/A#
1096N/A# When distributing Covered Code, include this CDDL HEADER in each
1096N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1096N/A# If applicable, add the following below this CDDL HEADER, with the
1096N/A# fields enclosed by brackets "[]" replaced with your own identifying
1096N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1096N/A#
1096N/A# CDDL HEADER END
2362N/A#
2362N/A#
2362N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
1096N/A# Use is subject to license terms.
1096N/A#
1096N/A# ident "%Z%%M% %I% %E% SMI"
1096N/A
1096N/A# if the audit state is "disabled" auditconfig returns
1096N/A# non-zero exit status unless the c2audit module is loaded;
1096N/A# if c2audit is loaded, "disabled" becomes "noaudit" early
2080N/A# in the boot cycle and "auditing" only after auditd starts.
1096N/A
1096N/A. /lib/svc/share/smf_include.sh
1096N/A
1096N/AAUDITCONFIG=/usr/sbin/auditconfig
1096N/A
1096N/AAUDITCOND=`$AUDITCONFIG -getcond 2> /dev/null`
1096N/A
1096N/Aif [ $? -ne 0 ]; then
1096N/A # The decision whether to start
1096N/A # auditing is driven by bsmconv / bsmunconv
1096N/A /usr/sbin/svcadm mark maintenance system/auditd
1096N/A exit $SMF_EXIT_MON_OFFLINE;
1096N/Afi
1096N/A
1096N/A# In a non-global zone, auditd is started only if the "perzone"
1096N/A# audit policy has been set.
1096N/Aif smf_is_nonglobalzone; then
1096N/A echo `$AUDITCONFIG -getpolicy` | grep perzone > /dev/null
1096N/A
1096N/A if [ $? -eq 1 ]; then
1096N/A echo "$0: auditd is not configured to run in a local zone"
1096N/A exit $SMF_EXIT_ERR_CONFIG;
1096N/A fi
1096N/Afi
1096N/A
1096N/A/etc/security/audit_startup
1096N/A# daemon forks, parent exits when child says it's ready
1096N/Aexec /usr/sbin/auditd
1096N/A
1096N/A