17c478bd9Sstevel@tonic-gate#!/sbin/sh 27c478bd9Sstevel@tonic-gate# 345916cd2Sjpk# 47c478bd9Sstevel@tonic-gate# CDDL HEADER START 57c478bd9Sstevel@tonic-gate# 67c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 745916cd2Sjpk# Common Development and Distribution License (the "License"). 845916cd2Sjpk# You may not use this file except in compliance with the License. 97c478bd9Sstevel@tonic-gate# 107c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 117c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 127c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 137c478bd9Sstevel@tonic-gate# and limitations under the License. 147c478bd9Sstevel@tonic-gate# 157c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 167c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 177c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 187c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 197c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# CDDL HEADER END 227c478bd9Sstevel@tonic-gate# 23cb5caa98Sdjl# 24bf1e3beeSmichen# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 257c478bd9Sstevel@tonic-gate# Use is subject to license terms. 26*f18d8787SJerry Jelinek# Copyright 2012 Joyent, Inc. All rights reserved. 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate. /lib/svc/share/smf_include.sh 307c478bd9Sstevel@tonic-gate 3145916cd2Sjpk# Trusted Extensions non-global zones need special handling 3245916cd2Sjpk 3345916cd2Sjpkif (smf_is_system_labeled); then 3445916cd2Sjpk if (smf_is_nonglobalzone); then 35bf1e3beeSmichen if [ ! -f /var/tsol/doors/nscd_per_label ]; then 3645916cd2Sjpk 3745916cd2Sjpk # If needed create a door to the global zone daemon. 38bf1e3beeSmichen if [ -r /var/run/name_service_door ]; then 39bf1e3beeSmichen rm /var/run/name_service_door 4045916cd2Sjpk fi 41bf1e3beeSmichen ln -s /var/tsol/doors/name_service_door \ 42bf1e3beeSmichen /var/run || exit $SMF_EXIT_ERR_FATAL 4345916cd2Sjpk 44bf1e3beeSmichen # If current service duration is not "transient", 45bf1e3beeSmichen # create a dummy background process to preserve 46bf1e3beeSmichen # contract lifetime. 4745916cd2Sjpk duration="" 48bf1e3beeSmichen if /bin/svcprop -q -c -p startd/duration $SMF_FMRI 49bf1e3beeSmichen then 50bf1e3beeSmichen duration=`/bin/svcprop -c -p startd/duration \ 51bf1e3beeSmichen $SMF_FMRI` 5245916cd2Sjpk fi 5345916cd2Sjpk if [ "$duration" != "transient" ]; then 54*f18d8787SJerry Jelinek [ -n "$SMF_EXIT_NODAEMON" ] && \ 55*f18d8787SJerry Jelinek exit $SMF_EXIT_NODAEMON 5645916cd2Sjpk (while true ; do sleep 3600 ; done) & 5745916cd2Sjpk fi 5845916cd2Sjpk 5945916cd2Sjpk # The real daemon is not started in non-global zones, 6045916cd2Sjpk # so exit now. 6145916cd2Sjpk exit $SMF_EXIT_OK 62bf1e3beeSmichen else 63bf1e3beeSmichen # remove the door to the global zone daemon 64bf1e3beeSmichen if [ -L /var/run/name_service_door ]; then 65bf1e3beeSmichen rm /var/run/name_service_door 6645916cd2Sjpk fi 67bf1e3beeSmichen fi 68bf1e3beeSmichen fi 6945916cd2Sjpkfi 7045916cd2Sjpk 717c478bd9Sstevel@tonic-gateif [ -f /etc/nscd.conf -a -f /usr/sbin/nscd ]; then 72cb5caa98Sdjl /usr/sbin/nscd < /dev/null > /dev/msglog 2>&1 & 737c478bd9Sstevel@tonic-gateelse 747c478bd9Sstevel@tonic-gate echo "No /etc/nscd.conf or no /usr/sbin/nscd" 757c478bd9Sstevel@tonic-gate exit $SMF_EXIT_ERR_CONFIG 767c478bd9Sstevel@tonic-gatefi 77