summaryrefslogtreecommitdiff
path: root/usr/src/cmd/nscd
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2019-02-20 14:12:12 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2019-02-22 15:50:43 +0000
commitf18d8787c0ba765f61b003e2aae78db90b48f833 (patch)
treec7d48278a870c4982aa48b73e71460a9b092782b /usr/src/cmd/nscd
parent2ac157364c5658332f534eb882a4a2cd4926c5d7 (diff)
downloadillumos-joyent-f18d8787c0ba765f61b003e2aae78db90b48f833.tar.gz
7928 Add support for SMF_EXIT_NODAEMON
Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Jason King <jason.king@joyent.com> Reviewed by: Gergő Mihály Doma <domag02@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/cmd/nscd')
-rw-r--r--usr/src/cmd/nscd/svc-nscd42
1 files changed, 22 insertions, 20 deletions
diff --git a/usr/src/cmd/nscd/svc-nscd b/usr/src/cmd/nscd/svc-nscd
index 0c6aa1bc4b..c9f23f7088 100644
--- a/usr/src/cmd/nscd/svc-nscd
+++ b/usr/src/cmd/nscd/svc-nscd
@@ -23,8 +23,8 @@
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2012 Joyent, Inc. All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
. /lib/svc/share/smf_include.sh
@@ -34,34 +34,36 @@ if (smf_is_system_labeled); then
if (smf_is_nonglobalzone); then
if [ ! -f /var/tsol/doors/nscd_per_label ]; then
- # If needed create a door to the global zone daemon.
- if [ -r /var/run/name_service_door ]; then
+ # If needed create a door to the global zone daemon.
+ if [ -r /var/run/name_service_door ]; then
rm /var/run/name_service_door
- fi
- ln -s /var/tsol/doors/name_service_door \
+ fi
+ ln -s /var/tsol/doors/name_service_door \
/var/run || exit $SMF_EXIT_ERR_FATAL
- # If current service duration is not "transient",
- # create a dummy background process to preserve
+ # If current service duration is not "transient",
+ # create a dummy background process to preserve
# contract lifetime.
- duration=""
- if /bin/svcprop -q -c -p startd/duration $SMF_FMRI
+ duration=""
+ if /bin/svcprop -q -c -p startd/duration $SMF_FMRI
then
- duration=`/bin/svcprop -c -p startd/duration \
+ duration=`/bin/svcprop -c -p startd/duration \
$SMF_FMRI`
- fi
- if [ "$duration" != "transient" ]; then
- ( while true ; do sleep 3600 ; done ) &
- fi
+ fi
+ if [ "$duration" != "transient" ]; then
+ [ -n "$SMF_EXIT_NODAEMON" ] && \
+ exit $SMF_EXIT_NODAEMON
+ (while true ; do sleep 3600 ; done) &
+ fi
- # The real daemon is not started in non-global zones,
+ # The real daemon is not started in non-global zones,
# so exit now.
- exit $SMF_EXIT_OK
+ exit $SMF_EXIT_OK
else
- # remove the door to the global zone daemon
- if [ -L /var/run/name_service_door ]; then
- rm /var/run/name_service_door
- fi
+ # remove the door to the global zone daemon
+ if [ -L /var/run/name_service_door ]; then
+ rm /var/run/name_service_door
+ fi
fi
fi
fi