1#!/bin/ksh 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 5 unchanged lines hidden (view full) --- 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# |
22# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. |
23# |
24 25# 0a Initialization. 26 27[ -f /lib/svc/share/smf_include.sh ] || exit 1 28 29. /lib/svc/share/smf_include.sh 30 31activity=false 32 33EMI_SERVICE="svc:/system/early-manifest-import:default" |
34PROFILE_DIR_SITE="/etc/svc/profile/site" |
35 36X= 37early=false 38[ "$SMF_FMRI" == "$EMI_SERVICE" ] && early=true 39while getopts "n" opt; do 40 case $opt in 41 n) X=echo;; 42 ?) echo "Usage: /lib/svc/method/manifest-import [-n]\n" --- 10 unchanged lines hidden (view full) --- 53 54# 55# If the smf/manifest table has file entries that are missing 56# then there is work to be done by the cleanup process. 57# 58function cleanup_needwork { 59 if [ "$early" == true ]; then 60 smfmfiles=`/usr/bin/svcprop smf/manifest | \ |
61 awk '(/^lib_/ && /\/manifestfile /) {print $3}'` |
62 else 63 smfmfiles=`/usr/bin/svcprop smf/manifest | \ 64 awk '/\/manifestfile / {print $3}'` 65 fi 66 67 nw=`/lib/svc/bin/mfstscan $smfmfiles 2>&1 1>/dev/null` 68 [ "$nw" ] && return 1 69 --- 88 unchanged lines hidden (view full) --- 158 } 159 160 # 161 # Move symlinks from /var/svc/profile to /etc/svc/profile 162 # 163 generic_prof="/var/svc/profile/generic.xml" 164 ns_prof="/var/svc/profile/name_service.xml" 165 inetd_prof="/var/svc/profile/inetd_services.xml" |
166 platform_prof="/var/svc/profile/platform.xml" |
167 [ -L "$generic_prof" ] && mv $generic_prof /etc/svc/profile/ 168 [ -L "$ns_prof" ] && mv $ns_prof /etc/svc/profile/ 169 [ -L "$inetd_prof" ] && mv $inetd_prof /etc/svc/profile/ |
170 [ -L "$platform_prof" ] && mv $platform_prof /etc/svc/profile/ |
171 172 return 0 173} 174 175# 176# 2. Manifest import. Application directories first, then 177# site-specific manifests. 178# --- 135 unchanged lines hidden (view full) --- 314 if [ -f "${datalink_script}" ]; then 315 /usr/bin/mv "${datalink_script}" \ 316 "${datalink_script}".app.`date +\%Y\%m\%d\%H\%M\%S` 317 fi 318 ) 319} 320 321# |
322# 5. Giving administrator the final say, apply site.xml profile and profiles 323# under /etc/svc/profile/site directory. |
324# 325function apply_site_profile { 326 typeset prefix="$1/svc/profile" 327 [ -f $prefix/site.xml ] && svccfg_apply $prefix/site.xml |
328 329 if [ -d $PROFILE_DIR_SITE -a "$1" = "/etc" ]; then 330 svccfg_apply $PROFILE_DIR_SITE 331 fi |
332} 333 334# 335# 0b Cleanup deathrow 336# 337if [ "$early" = "false" ];then 338 deathrow=/etc/svc/deathrow 339 if [ -s $deathrow ];then --- 129 unchanged lines hidden --- |