svc-auditd revision f89940742f5d14dde79b69b98a414dd7b7f585c7
842ae4bd224140319ae7feec1872b93dfd491143fielding# CDDL HEADER START
842ae4bd224140319ae7feec1872b93dfd491143fielding# The contents of this file are subject to the terms of the
842ae4bd224140319ae7feec1872b93dfd491143fielding# Common Development and Distribution License (the "License").
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# You may not use this file except in compliance with the License.
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# See the License for the specific language governing permissions
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# and limitations under the License.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd# When distributing Covered Code, include this CDDL HEADER in each
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# If applicable, add the following below this CDDL HEADER, with the
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein# fields enclosed by brackets "[]" replaced with your own identifying
ab5581cc78e9d865b0a6ab1404c53347b3276968rbb# information: Portions Copyright [yyyy] [name of copyright owner]
b82089c85a796d6e047ccf2c97e872adec1475d7trawick# CDDL HEADER END
024cd9589e52cf11ce765dfddb5b5f0c6e421a48gstein# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# main - the execution starts there.
f706ad4ddbeb3b9814f52e83006e505cbb2cf662rbb # Do the basic argument inspection and take the appropriate action.
ca47a2b6bcea23e8af185c68f256dcbbfd2a0f9dtrawick# do_common - executes all the code common to all supported service methods.
1eb1f02a23de724c105b2c6c9fbd469a611059c6trawick # If the audit state is "disabled" auditconfig returns non-zero exit
1eb1f02a23de724c105b2c6c9fbd469a611059c6trawick # status unless the c2audit module is loaded; if c2audit is loaded,
1eb1f02a23de724c105b2c6c9fbd469a611059c6trawick # "disabled" becomes "noaudit" early in the boot cycle and "auditing"
5dce6b6dd8b82af80f9754ec4740ff61477a77b1gregames if [ $? -ne 0 ]; then
ca47a2b6bcea23e8af185c68f256dcbbfd2a0f9dtrawick echo "$0: Unable to get current kernel auditing condition."
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim # In a non-global zone, auditd is started/refreshed only if the
1eb1f02a23de724c105b2c6c9fbd469a611059c6trawick if [ $? -eq 1 ]; then
efc81fe729a2b7401028387da184b4a98f0b854atrawick if [ $? -ne 0 ]; then
efc81fe729a2b7401028387da184b4a98f0b854atrawick echo "$0: audit service misconfiguration detected (${val_err})"
efc81fe729a2b7401028387da184b4a98f0b854atrawick# do_start - service start method helper.
efc81fe729a2b7401028387da184b4a98f0b854atrawick # The transition of the audit_startup(1M) has to be performed.
d6a93816bfaa5b3de5f2e6cb0d172cbe20dd056ejerenkrantz $MV $AUDIT_STARTUP $AUDIT_STARTUP._transitioned_
d6a93816bfaa5b3de5f2e6cb0d172cbe20dd056ejerenkrantz if [ $? -ne 0 ]; then
d6a93816bfaa5b3de5f2e6cb0d172cbe20dd056ejerenkrantz # Unable to perform the backup of $AUDIT_STARTUP
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim # Refreshing service to make the newly created properties
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim if [ $? -ne 0 ]; then
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim echo "$0: Refresh of $AUDITD_FMRI configuration failed."
f4434a8c7b59509850470dfc3ebe2b79c9548649gregames echo "$0: Transition of audit_startup(1M) finished."
e8f95a682820a599fe41b22977010636be5c2717jim # Daemon forks, parent exits when child says it's ready.
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# do_refresh - service refresh method helper.
e8f95a682820a599fe41b22977010636be5c2717jim # The refresh capability is available only for those systems
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim # with already transformed audit_startup(1M) into $AUDITD_FMRI
d44472957ac24ca210655dc3255257bf0534bf90rbb # service properties. See do_start() for more information.
a18a308d7a942230edcde1bf00d7ae9b4b143c90trawick if [ $? -ne 0 ]; then
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim echo "$0: Service refresh method not supported on systems" \
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim "without converted audit_startup(1M) into auditd service" \
3a3d6060948b6fd3a0e127db51177a05a2d7941fjim# Call main() to start the own script execution.