7181923 svc:/application/texinfo-update should handle Immutable zones
authorBick Torrejon <Bick.Torrejon@oracle.COM>
Tue, 11 Sep 2012 14:09:47 -0700
changeset 971 345f87d27ffb
parent 970 96684f3b89ff
child 972 8009bf2d1781
7181923 svc:/application/texinfo-update should handle Immutable zones
components/texinfo/svc-texinfo-update
components/texinfo/texinfo-update.xml
--- a/components/texinfo/svc-texinfo-update	Tue Sep 11 05:08:20 2012 -0700
+++ b/components/texinfo/svc-texinfo-update	Tue Sep 11 14:09:47 2012 -0700
@@ -21,7 +21,7 @@
 #
 
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 
 . /lib/svc/share/smf_include.sh
@@ -84,10 +84,22 @@
 
 case "$1" in
 'start'|'refresh')
+	if [[ "$1" = 'start' ]]; then
+		if [[ ! -f "/.SELF-ASSEMBLY-REQUIRED" ]]; then
+			exit $SMF_EXIT_OK
+		fi
+	fi
+
 	# refresh texinfo directories
 	for dir_link in $(pkg search -H -l -o path ':link:path:*/info/dir' | \
 			  sort -u) ; do
-		populate_texinfo_directory /${dir_link}
+		# test the directory is writable
+		if [[ ! -w /${dir_link} ]]; then 
+			echo $SMF_EXIT_OK
+		else
+			populate_texinfo_directory /${dir_link}
+
+		fi
 	done
 	# remove any unreferenced directories
 	for link in $(find ${TEXINFO_DATA_DIR} -type l -name '*.backlink') ; do
--- a/components/texinfo/texinfo-update.xml	Tue Sep 11 05:08:20 2012 -0700
+++ b/components/texinfo/texinfo-update.xml	Tue Sep 11 14:09:47 2012 -0700
@@ -21,7 +21,7 @@
 
  CDDL HEADER END
 
- Copyright (c) 2011, Oracle and/or it's affiliates.  All rights reserved.
+ Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 
 	NOTE:  This service manifest is not editable; its contents will
 	be overwritten by package or patch operations, including
@@ -49,6 +49,13 @@
 		<service_fmri value='svc:/milestone/multi-user-server' />
 	</dependency>
 
+	<dependency
+		name='texinfo-update_self-assembly-complete'
+		grouping='optional_all'
+		restart_on='none'>
+		<service_fmri value='svc:/milestone/self-assembly-complete' />
+	</dependency>
+
 	<exec_method
 		type='method'
 		name='start'