svc-nscd revision cb5caa98562cf06753163f558cbcfe30b8f4673a
c3ff7979929443ce8cbc881239f6cf130b4e256aslive#!/sbin/sh
c3ff7979929443ce8cbc881239f6cf130b4e256aslive#
c3ff7979929443ce8cbc881239f6cf130b4e256aslive#
cf6d5fe78f4bffe1f0998439d87bd0951789d370bnicholes# CDDL HEADER START
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# The contents of this file are subject to the terms of the
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd# Common Development and Distribution License (the "License").
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# You may not use this file except in compliance with the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# or http://www.opensolaris.org/os/licensing.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# See the License for the specific language governing permissions
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# and limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# When distributing Covered Code, include this CDDL HEADER in each
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# If applicable, add the following below this CDDL HEADER, with the
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# fields enclosed by brackets "[]" replaced with your own identifying
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# information: Portions Copyright [yyyy] [name of copyright owner]
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd#
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd# CDDL HEADER END
7db9f691a00ead175b03335457ca296a33ddf31bnd#
c3ff7979929443ce8cbc881239f6cf130b4e256aslive#
c3ff7979929443ce8cbc881239f6cf130b4e256aslive# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
08842292d2f1550b40ae73e0dafc7641c5955c82nd# Use is subject to license terms.
08842292d2f1550b40ae73e0dafc7641c5955c82nd#
15ba1801088da1aad6d20609cf3f7b0b1eefce8aslive#ident "%Z%%M% %I% %E% SMI"
c3ff7979929443ce8cbc881239f6cf130b4e256aslive
c3ff7979929443ce8cbc881239f6cf130b4e256aslive. /lib/svc/share/smf_include.sh
c3ff7979929443ce8cbc881239f6cf130b4e256aslive
c3ff7979929443ce8cbc881239f6cf130b4e256aslive# Trusted Extensions non-global zones need special handling
c3ff7979929443ce8cbc881239f6cf130b4e256aslive
c3ff7979929443ce8cbc881239f6cf130b4e256asliveif (smf_is_system_labeled); then
c3ff7979929443ce8cbc881239f6cf130b4e256aslive if (smf_is_nonglobalzone); then
c3ff7979929443ce8cbc881239f6cf130b4e256aslive
c3ff7979929443ce8cbc881239f6cf130b4e256aslive # If needed create a door to the global zone daemon.
c3ff7979929443ce8cbc881239f6cf130b4e256aslive if [ ! -L /var/run/name_service_door ]; then
c3ff7979929443ce8cbc881239f6cf130b4e256aslive ln -s /var/tsol/doors/name_service_door /var/run || \
c3ff7979929443ce8cbc881239f6cf130b4e256aslive exit $SMF_EXIT_ERR_FATAL
c3ff7979929443ce8cbc881239f6cf130b4e256aslive fi
c3ff7979929443ce8cbc881239f6cf130b4e256aslive
c3ff7979929443ce8cbc881239f6cf130b4e256aslive # If current service duration is not "transient", create
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes # a dummy background process to preserve contract lifetime.
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes duration=""
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes if /bin/svcprop -q -c -p startd/duration $SMF_FMRI ; then
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes duration=`/bin/svcprop -c -p startd/duration $SMF_FMRI`
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes fi
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes if [ "$duration" != "transient" ]; then
7c0cea9cb6030e6a71ae18f2aedb47a6c32678febnicholes ( while true ; do sleep 3600 ; done ) &
c3ff7979929443ce8cbc881239f6cf130b4e256aslive fi
c3ff7979929443ce8cbc881239f6cf130b4e256aslive
c3ff7979929443ce8cbc881239f6cf130b4e256aslive # The real daemon is not started in non-global zones,
08842292d2f1550b40ae73e0dafc7641c5955c82nd # so exit now.
08842292d2f1550b40ae73e0dafc7641c5955c82nd exit $SMF_EXIT_OK
cf6d5fe78f4bffe1f0998439d87bd0951789d370bnicholes fi
08842292d2f1550b40ae73e0dafc7641c5955c82nd
08842292d2f1550b40ae73e0dafc7641c5955c82ndfi
08842292d2f1550b40ae73e0dafc7641c5955c82nd
08842292d2f1550b40ae73e0dafc7641c5955c82ndif [ -f /etc/nscd.conf -a -f /usr/sbin/nscd ]; then
cf6d5fe78f4bffe1f0998439d87bd0951789d370bnicholes /usr/sbin/nscd < /dev/null > /dev/msglog 2>&1 &
08842292d2f1550b40ae73e0dafc7641c5955c82ndelse
08842292d2f1550b40ae73e0dafc7641c5955c82nd echo "No /etc/nscd.conf or no /usr/sbin/nscd"
08842292d2f1550b40ae73e0dafc7641c5955c82nd exit $SMF_EXIT_ERR_CONFIG
08842292d2f1550b40ae73e0dafc7641c5955c82ndfi
08842292d2f1550b40ae73e0dafc7641c5955c82nd