246 # Zone is not configured
247 # as brand type lx
248 # according to zonecfg
249 # info.
250 # @user_action
251 # Review the components
252 # configuration file and
253 # make sure the variable
254 # Zonebrand defines "lx"
255 # only for a Zone that
256 # got really setup with
257 # brand type "lx".
258 scds_syslog -p daemon.err \
259 -t $(syslog_tag) -m \
260 "Function: validate - Zonebrand for zone %s is configured as lx, but the zone is configured as brand type %s." \
261 "${Zonename}" "${ZONE_BRAND}"
262 rc_validate=1
263 fi
264 fi;;
265
266 solaris8)
267 debug_message "Function: validate - Zonebrand configured as ${Zonebrand}"
268 if [ "`/usr/bin/uname -p`" != "sparc" ]; then
269 # SCMSGS
270 # @explanation
271 # The solaris8 brand for
272 # zones is only
273 # supported on the
274 # sparc platform.
275 # @user_action
276 # Review the components
277 # configuration file and
278 # make sure the variable
279 # Zonebrand defines
280 # "solaris8" only on a
281 # sparc system.
282 scds_syslog -p daemon.err \
283 -t $(syslog_tag) -m \
284 "Function: validate - Zonebrand for zone %s is configured as %s on a non-sparc system. It is only supported on sparc systems." \
285 "${Zonename}" "${Zonebrand}"
286 rc_validate=1
287 else
288 ZONE_BRAND=`${ZONECFG} -z ${Zonename} info | /bin/grep "^brand:" | /bin/awk '{print $2}'`
289 if [ "${ZONE_BRAND}" = "solaris8" ]; then
290 debug_message "Function: validate - Zonebrand verified as being ${ZONE_BRAND}"
291 else
292 # SCMSGS
293 # @explanation
294 # Zonebrand is set to
295 # "solaris8". But the
296 # Zone is not configured
297 # as brand type solaris8
298 # according to zonecfg
299 # info.
300 # @user_action
301 # Review the components
302 # configuration file and
303 # make sure the variable
304 # Zonebrand defines
305 # "solaris8" only for a
306 # Zone that got really
307 # setup with brand type
308 # "solaris8".
309 scds_syslog -p daemon.err \
310 -t $(syslog_tag) -m \
311 "Function: validate - Zonebrand for zone %s is configured as solaris8, but the zone is configured as brand type %s." \
312 "${Zonename}" "${ZONE_BRAND}"
313 rc_validate=1
314 fi
315 fi;;
316
317 *)
318 # SCMSGS
319 # @explanation
320 # Currently Zonebrand can only
321 # be set to "native", "lx" or
322 # "solaris8".
323 # @user_action
324 # Review the components
325 # configuration file and make
326 # sure the variable Zonebrand
327 # defines either "native", "lx"
328 # or "solaris8".
329 scds_syslog -p daemon.err \
330 -t $(syslog_tag) -m \
331 "Function: validate - Zonebrand for zone %s is configured as %s. Valid values are native, lx and solaris8." \
332 "${Zonename}" "${Zonebrand}"
333 rc_validate=1;;
334 esac;;
335
336 Zonebootopt)
337
338 # test the Zones boot options
339
340 # is the Zone boot option specified and a supported one
341
342 if [ ! -z ${Zonebootopt} ] && [ "${Zonebootopt}" != "-s" ]; then
343
344 # SCMSGS
345 # @explanation
346 # The specified boot option is not allowed.
347 # @user_action
348 # Consult the manpage of zoneadm which boot
349 # options are allowed and specify one of
350 # them.
351 scds_syslog -p daemon.err -t $(syslog_tag) -m \
383 # verify that LXrunlevel is setup if Zonebrand="lx"
384
385 if [ -z "${LXrunlevel}" ] && [ "${Zonebrand}" = "lx" ]; then
386 # SCMSGS
387 # @explanation
388 # The LXrunlevel variable is not set in the
389 # parameter file sczbt_<resource name>.
390 # @user_action
391 # Set the LXrunlevel variable in the parameter
392 # file sczbt_<resource name>.
393 scds_syslog -p daemon.err -t $(syslog_tag) -m \
394 "Function: validate - LXrunlevel not set in %s" \
395 "${PARFILE}"
396 rc_validate=1
397 else
398 debug_message "Function: validate - LXrunlevel (${LXrunlevel}) set"
399 fi;;
400
401 SLrunlevel)
402
403 # verify that SLrunlevel is setup if Zonebrand="solaris8"
404
405 if [ -z "${SLrunlevel}" ] && [ "${Zonebrand}" = "solaris8" ]; then
406 # SCMSGS
407 # @explanation
408 # The SLrunlevel variable is not set in the
409 # parameter file sczbt_<resource name>.
410 # @user_action
411 # Set the SLrunlevel variable in the parameter
412 # file sczbt_<resource name>.
413 scds_syslog -p daemon.err -t $(syslog_tag) -m \
414 "Function: validate - SLrunlevel not set in %s" \
415 "${PARFILE}"
416 rc_validate=1
417 else
418 debug_message "Function: validate - SLrunlevel (${SLrunlevel}) set"
419 fi;;
420
421 esac
422 done
423
424 # validates the Zonepath
425
594 fi;;
595
596 lx)
597 if [ "${LXrunlevel}" != "unknown" ]
598 then
599 # SCMSGS
600 # @explanation
601 # The Zoneboot variable is set to -s. Every
602 # LXrunlevel other than "unknown" is invalid.
603 # @user_action
604 # Correct the LXrunlevel variable in the
605 # paramter file sczbt_<resource name>. You need
606 # to specify "unknown" together with the boot
607 # option -s.
608 scds_syslog -p daemon.err -t $(syslog_tag) -m \
609 "Function: validate - LXrunlevel (%s) is invalid with Zonebootopt=%s, needs single-user" \
610 "${LXrunlevel}" "${Zonebootopt}"
611 rc_validate=1
612 fi;;
613
614 solaris8)
615 if [ "${SLrunlevel}" != "S" ]
616 then
617 # SCMSGS
618 # @explanation
619 # The Zoneboot variable is set to -s. Every
620 # SLrunlevel other than "S" is invalid.
621 # @user_action
622 # Correct the SLrunlevel variable in the
623 # paramter file sczbt_<resource name>. You need
624 # to specify "S" together with the boot
625 # option -s.
626 scds_syslog -p daemon.err -t $(syslog_tag) -m \
627 "Function: validate - SLrunlevel (%s) is invalid with Zonebootopt=%s, needs single-user" \
628 "${SLrunlevel}" "${Zonebootopt}"
629 rc_validate=1
630 fi;;
631
632 esac
633 fi
634
882 done
883
884 # Get the Online IPMP adapter list for that IPMP Group
885
886 LOCALNODENAME=`${SCHA_CLUSTER_GET} -O NODENAME_LOCAL`
887
888 ADAPTER_LIST=`/bin/env LC_ALL=POSIX ${SCSTAT} -i -h ${LOCALNODENAME} | /bin/grep " ${IPMP_GROUP} " | /bin/grep Online | /bin/awk '{print $6}'`
889
890 debug_message "Function: get_ipmp_state - End"
891 }
892
893 start_sczbt()
894 {
895 #
896 # Start sczbt
897 #
898
899 debug_message "Function: start_sczbt - Begin"
900 ${SET_DEBUG}
901
902 # If the zone is of brand type "solaris8" and if the platform changed
903 # from where the zone was previously started, the s8_p2v script needs
904 # to get called prior boot to make sure that any platform specific
905 # libraries are properly setup within the zone rootpath.
906 # The script needs to run only once per new platform. The file
907 # .platform.orig stores the platform names for which the s8_p2v script
908 # had already run. Only if a new platform gets introduced into the
909 # cluster, the s8_p2v script gets called on that node again.
910 if [ "${Zonebrand}" = "solaris8" ]; then
911
912 get_zonepath ${Zonename}
913
914 myplatform=`/bin/uname -i`
915 myplatformfile=${Zonepath}/root/.platform.orig
916 need_s8_p2v=true
917
918 # if there is no .platform.orig file or if the current
919 # platform is not contained, s8_p2v needs to run
920 if [ -f ${myplatformfile} ]; then
921
922 if /usr/bin/grep "^${myplatform}$" ${myplatformfile} > /dev/null 2>&1
923 then
924 need_s8_p2v=false
925 fi
926 fi
927
928 if [ -x /usr/lib/brand/solaris8/s8_p2v -a "${need_s8_p2v}" = "true" ]; then
929 /usr/lib/brand/solaris8/s8_p2v ${Zonename} >${LOGFILE} 2>&1
930 if [ $? -ne 0 ]; then
931 # SCMSGS
932 # @explanation
933 # Unable to perform platform specific
934 # setup for the solaris8 zone.
935 # @user_action
936 # Disable the resource and manually run
937 # the /usr/lib/brand/solaris8/s8_p2v
938 # <zonename> command on the node where
939 # the start failed. Correct any errors
940 # reported, then restart the resource.
941 scds_syslog -p daemon.err -t $(syslog_tag) -m \
942 "Function: start_sczbt - Running command /usr/lib/brand/solaris8/s8_p2v %s failed. Unable to start zone." \
943 "${Zonename}"
944 rc_start_command=1
945 return 1
946 fi
947
948 # Only update the file if it is not a symbolic link.
949 # Otherwise it would be a security issue.
950 if [ ! -h ${myplatformfile} ]; then
951 # Add platform to the .platform.orig file
952 echo ${myplatform} >> ${myplatformfile}
953 fi
954 fi
955
956 # Only update the file if it is not a symbolic link.
957 # Otherwise it would be a security issue.
958 if [ ! -h ${Zonepath}/root/.host.orig ]; then
959 # This update is necessary to make sure the
960 # solaris8 zone can get booted without manual
961 # intervention.
962 /usr/bin/hostid > ${Zonepath}/root/.host.orig
963 fi
964 fi
965
966 # boot the zone
967 ${ZONEADM} -z ${Zonename} boot ${Zonebootopt} >>${LOGFILE} 2>&1
968
969 rc_start_command=${?}
970
971 # disable the pmf tag and run a sleep in the background, to assure, that there will be a valid pmftag during the start phase
972
973 START_TIMEOUT=`${SCHA_RESOURCE_GET} -O START_TIMEOUT -R ${RESOURCE} -G ${RESOURCEGROUP}`
974 sleep ${START_TIMEOUT} &
975
976 ${PMFADM} -s ${RESOURCEGROUP},${RESOURCE},0.svc
977
978 # mount the requested loopbakcmount to the local zone
979
980 if ! lofs_mounts
981 then
1108 # of
1109 # the
1110 # sczbt
1111 # component.
1112 # @user_action
1113 # None
1114 scds_syslog -p daemon.notice -t $(syslog_tag) -m \
1115 "Function: stop_sczbt - Logical interface %s:%s placed into the global zone" \
1116 "${ADAPTER}" "${i}"
1117 fi
1118 fi
1119 fi
1120 done
1121 done
1122 done
1123 done
1124 fi
1125
1126 # bring down the zone
1127 debug_message "Function: stop_sczbt - Shuting down non-global zone ${Zonename}"
1128 if [ "${Zonebrand}" = "native" -o "${Zonebrand}" = "solaris8" ]; then
1129 ${ZLOGIN} ${Zonename} /usr/sbin/shutdown -y -g0 -i0 >${LOGFILE} 2>&1
1130 else
1131 # we must be an "lx" brand
1132 ${ZLOGIN} ${Zonename} /sbin/shutdown -h now >${LOGFILE} 2>&1
1133 fi
1134
1135 #
1136 # run a test loop to determine if the zone reached state "installed"
1137 # or if the timeout for proper shutdown is exceeded
1138 #
1139 while [ ${SECONDS} -lt ${MAX_STOP_TIMEOUT} ]
1140 do
1141 # check if the zone reached state "installed"
1142 get_zone_state ${Zonename}
1143 debug_message "Function: stop_sczbt - ${Zonename} state is ${ZONE_STATE}, time passed while waiting for shutdown: ${SECONDS}"
1144 if [ "${ZONE_STATE}" = "installed" ]; then
1145 SECONDS=${MAX_STOP_TIMEOUT}
1146 else
1147 # wait 4 seconds
1148 sleep 4
1149 fi
1150 done
1151
1152 #
1153 # bring the zone down at all costs if the shutdown has exceeded
1285 then
1286 rc_check_sczbt=100
1287 debug_message "Function: check_sczbt - ${Zonename} milestone (${Milestone}) state is ${SVC_STATE}"
1288 return ${rc_check_sczbt}
1289 fi;;
1290 lx)
1291 if get_lx_state ${Zonename}
1292 then
1293 if [ "${LX_STATE}" != "${LXrunlevel}" ]
1294 then
1295 rc_check_sczbt=100
1296 debug_message "Function: check_sczbt - ${Zonename} runlevel (${LXrunlevel}) state is ${LX_STATE}"
1297 return ${rc_check_sczbt}
1298 fi
1299 else
1300 rc_check_sczbt=100
1301 debug_message "Function: check_sczbt - runlevel did not return successfully (return code ${rc_get_lx_state}) for the non-global zone {Zonename}"
1302 return ${rc_check_sczbt}
1303 fi;;
1304
1305 solaris8)
1306 if get_solaris_legacy_state ${Zonename}
1307 then
1308 if [ "${SOLARIS_LEGACY_STATE}" != "${SLrunlevel}" ]
1309 then
1310 rc_check_sczbt=100
1311 debug_message "Function: check_sczbt - ${Zonename} runlevel (${SLrunlevel}) state is ${SOLARIS_LEGACY_STATE}"
1312 return ${rc_check_sczbt}
1313 fi
1314 else
1315 rc_check_sczbt=100
1316 debug_message "Function: check_sczbt - runlevel did not return successfully (return code ${rc_get_solaris_legacy_state}) for the non-global zone {Zonename}"
1317 return ${rc_check_sczbt}
1318 fi;;
1319 esac
1320
1321 else
1322
1323 # check if the scheduler is running
1324
1325 if ! /bin/pgrep -z ${Zonename} zsched>/dev/null 2>&1
1436 SECONDS=${MAX_PROBE_TIMEOUT}
1437 rc_check_sczbt=0
1438 fi
1439 else
1440 # SCMSGS
1441 # @explanation
1442 # The runlevel command did not run
1443 # successfully in the configured
1444 # non-global zone. The state is
1445 # checked again in 5 seconds.
1446 # @user_action
1447 # None.
1448 scds_syslog -p daemon.err -t $(syslog_tag) -m \
1449 "Function: check_sczbt - runlevel did not run successfully (return code %s) in the non-global zone %s, try again in 5 seconds" \
1450 "${rc_get_lx_state}" "${Zonename}"
1451 rc_check_sczbt=100
1452 sleep 5
1453 fi
1454 done;;
1455
1456 solaris8)
1457 while [ ${SECONDS} -lt ${MAX_PROBE_TIMEOUT} ]
1458 do
1459 if get_solaris_legacy_state ${Zonename}
1460 then
1461 if [ "${SOLARIS_LEGACY_STATE}" != "${SLrunlevel}" ]
1462 then
1463 # SCMSGS
1464 # @explanation
1465 # The legacy runlevel is not
1466 # equal to the configured
1467 # SLrunlevel. The state is
1468 # checked again in 5 seconds.
1469 # @user_action
1470 # None.
1471 scds_syslog -p daemon.err -t $(syslog_tag) -m \
1472 "Function: check_sczbt - %s legacy runlevel [%s] not online, runlevel is %s, try again in 5 seconds" \
1473 "${Zonename}" "${SLrunlevel}" "${SOLARIS_LEGACY_STATE}"
1474 rc_check_sczbt=100
1475 sleep 5
1476 else
|
246 # Zone is not configured
247 # as brand type lx
248 # according to zonecfg
249 # info.
250 # @user_action
251 # Review the components
252 # configuration file and
253 # make sure the variable
254 # Zonebrand defines "lx"
255 # only for a Zone that
256 # got really setup with
257 # brand type "lx".
258 scds_syslog -p daemon.err \
259 -t $(syslog_tag) -m \
260 "Function: validate - Zonebrand for zone %s is configured as lx, but the zone is configured as brand type %s." \
261 "${Zonename}" "${ZONE_BRAND}"
262 rc_validate=1
263 fi
264 fi;;
265
266 solaris8|solaris9)
267 debug_message "Function: validate - Zonebrand configured as ${Zonebrand}"
268 if [ "`/usr/bin/uname -p`" != "sparc" ]; then
269 # SCMSGS
270 # @explanation
271 # The solaris8 and
272 # solaris9 brand for
273 # zones is only
274 # supported on the
275 # sparc platform.
276 # @user_action
277 # Review the components
278 # configuration file and
279 # make sure the variable
280 # Zonebrand defines
281 # "solaris8" or
282 # "solaris9" only on a
283 # sparc system.
284 scds_syslog -p daemon.err \
285 -t $(syslog_tag) -m \
286 "Function: validate - Zonebrand for zone %s is configured as %s on a non-sparc system. It is only supported on sparc systems." \
287 "${Zonename}" "${Zonebrand}"
288 rc_validate=1
289 else
290 ZONE_BRAND=`${ZONECFG} -z ${Zonename} info | /bin/grep "^brand:" | /bin/awk '{print $2}'`
291 if [ "${ZONE_BRAND}" = "${Zonebrand}" ]; then
292 debug_message "Function: validate - Zonebrand verified as being ${ZONE_BRAND}"
293 else
294 # SCMSGS
295 # @explanation
296 # Zonebrand is set to
297 # "solaris8" or
298 # "solaris9". But the
299 # Zone is not configured
300 # as brand type solaris8
301 # or solaris9
302 # according to zonecfg
303 # info.
304 # @user_action
305 # Review the components
306 # configuration file and
307 # make sure the variable
308 # Zonebrand defines
309 # "solaris8" or
310 # "solaris9" only for a
311 # Zone that got really
312 # setup with brand type
313 # "solaris8" or
314 # "solaris9".
315 scds_syslog -p daemon.err \
316 -t $(syslog_tag) -m \
317 "Function: validate - Zonebrand for zone %s is configured as %s, but the zone is configured as brand type %s." \
318 "${Zonename}" "${Zonebrand}" "${ZONE_BRAND}"
319 rc_validate=1
320 fi
321 fi;;
322
323 *)
324 # SCMSGS
325 # @explanation
326 # Currently Zonebrand can only
327 # be set to "native", "lx" or
328 # "solaris8".
329 # @user_action
330 # Review the components
331 # configuration file and make
332 # sure the variable Zonebrand
333 # defines either "native", "lx"
334 # or "solaris8".
335 scds_syslog -p daemon.err \
336 -t $(syslog_tag) -m \
337 "Function: validate - Zonebrand for zone %s is configured as %s. Valid values are native, lx, solaris8 and solaris9." \
338 "${Zonename}" "${Zonebrand}"
339 rc_validate=1;;
340 esac;;
341
342 Zonebootopt)
343
344 # test the Zones boot options
345
346 # is the Zone boot option specified and a supported one
347
348 if [ ! -z ${Zonebootopt} ] && [ "${Zonebootopt}" != "-s" ]; then
349
350 # SCMSGS
351 # @explanation
352 # The specified boot option is not allowed.
353 # @user_action
354 # Consult the manpage of zoneadm which boot
355 # options are allowed and specify one of
356 # them.
357 scds_syslog -p daemon.err -t $(syslog_tag) -m \
389 # verify that LXrunlevel is setup if Zonebrand="lx"
390
391 if [ -z "${LXrunlevel}" ] && [ "${Zonebrand}" = "lx" ]; then
392 # SCMSGS
393 # @explanation
394 # The LXrunlevel variable is not set in the
395 # parameter file sczbt_<resource name>.
396 # @user_action
397 # Set the LXrunlevel variable in the parameter
398 # file sczbt_<resource name>.
399 scds_syslog -p daemon.err -t $(syslog_tag) -m \
400 "Function: validate - LXrunlevel not set in %s" \
401 "${PARFILE}"
402 rc_validate=1
403 else
404 debug_message "Function: validate - LXrunlevel (${LXrunlevel}) set"
405 fi;;
406
407 SLrunlevel)
408
409 # verify that SLrunlevel is setup if Zonebrand is set
410 # to "solaris8" or "solaris9"
411
412 if [ -z "${SLrunlevel}" ] && [ "${Zonebrand}" = "solaris8" -o "${Zonebrand}" = "solaris9" ]; then
413 # SCMSGS
414 # @explanation
415 # The SLrunlevel variable is not set in the
416 # parameter file sczbt_<resource name>.
417 # @user_action
418 # Set the SLrunlevel variable in the parameter
419 # file sczbt_<resource name>.
420 scds_syslog -p daemon.err -t $(syslog_tag) -m \
421 "Function: validate - SLrunlevel not set in %s" \
422 "${PARFILE}"
423 rc_validate=1
424 else
425 debug_message "Function: validate - SLrunlevel (${SLrunlevel}) set"
426 fi;;
427
428 esac
429 done
430
431 # validates the Zonepath
432
601 fi;;
602
603 lx)
604 if [ "${LXrunlevel}" != "unknown" ]
605 then
606 # SCMSGS
607 # @explanation
608 # The Zoneboot variable is set to -s. Every
609 # LXrunlevel other than "unknown" is invalid.
610 # @user_action
611 # Correct the LXrunlevel variable in the
612 # paramter file sczbt_<resource name>. You need
613 # to specify "unknown" together with the boot
614 # option -s.
615 scds_syslog -p daemon.err -t $(syslog_tag) -m \
616 "Function: validate - LXrunlevel (%s) is invalid with Zonebootopt=%s, needs single-user" \
617 "${LXrunlevel}" "${Zonebootopt}"
618 rc_validate=1
619 fi;;
620
621 solaris8|solaris9)
622 if [ "${SLrunlevel}" != "S" ]
623 then
624 # SCMSGS
625 # @explanation
626 # The Zoneboot variable is set to -s. Every
627 # SLrunlevel other than "S" is invalid.
628 # @user_action
629 # Correct the SLrunlevel variable in the
630 # paramter file sczbt_<resource name>. You need
631 # to specify "S" together with the boot
632 # option -s.
633 scds_syslog -p daemon.err -t $(syslog_tag) -m \
634 "Function: validate - SLrunlevel (%s) is invalid with Zonebootopt=%s, needs single-user" \
635 "${SLrunlevel}" "${Zonebootopt}"
636 rc_validate=1
637 fi;;
638
639 esac
640 fi
641
889 done
890
891 # Get the Online IPMP adapter list for that IPMP Group
892
893 LOCALNODENAME=`${SCHA_CLUSTER_GET} -O NODENAME_LOCAL`
894
895 ADAPTER_LIST=`/bin/env LC_ALL=POSIX ${SCSTAT} -i -h ${LOCALNODENAME} | /bin/grep " ${IPMP_GROUP} " | /bin/grep Online | /bin/awk '{print $6}'`
896
897 debug_message "Function: get_ipmp_state - End"
898 }
899
900 start_sczbt()
901 {
902 #
903 # Start sczbt
904 #
905
906 debug_message "Function: start_sczbt - Begin"
907 ${SET_DEBUG}
908
909 # If the zone is of brand type "solaris8" or "solaris9" and if the
910 # platform changed from where the zone was previously started,
911 # the s8_p2v or s9_p2v script needs to get called prior boot to make
912 # sure that any platform specific libraries are properly setup within
913 # the zone rootpath.
914 # The script needs to run only once per new platform. The file
915 # .platform.orig stores the platform names for which the s8_p2v or
916 # s9_p2v script had already run. Only if a new platform gets introduced
917 # into the cluster, the s8_p2v or s9_p2v script gets called on that
918 # node again.
919 if [ "${Zonebrand}" = "solaris8" -o "${Zonebrand}" = "solaris9" ]; then
920
921 case ${Zonebrand} in
922 solaris8)
923 P2V_SCRIPT=/usr/lib/brand/solaris8/s8_p2v
924 ;;
925 solaris9)
926 P2V_SCRIPT=/usr/lib/brand/solaris9/s9_p2v
927 ;;
928 esac
929
930 get_zonepath ${Zonename}
931
932 myplatform=`/bin/uname -i`
933 myplatformfile=${Zonepath}/root/.platform.orig
934 need_p2v=true
935
936 # if there is no .platform.orig file or if the current
937 # platform is not contained, s8_p2v needs to run
938 if [ -f ${myplatformfile} ]; then
939
940 if /usr/bin/grep "^${myplatform}$" ${myplatformfile} > /dev/null 2>&1
941 then
942 need_p2v=false
943 fi
944 fi
945
946 if [ -x "${P2V_SCRIPT}" -a "${need_p2v}" = "true" ]; then
947 ${P2V_SCRIPT} ${Zonename} >${LOGFILE} 2>&1
948 if [ $? -ne 0 ]; then
949 # SCMSGS
950 # @explanation
951 # Unable to perform platform specific
952 # setup for the solaris8 or solaris9 zone.
953 # @user_action
954 # Disable the resource and manually run
955 # '/usr/lib/brand/solaris8/s8_p2v
956 # <zonename>' for solaris8 or
957 # '/usr/lib/brand/solaris9/s9_p2v <zonename>'
958 # for solaris9 on the node where the start
959 # failed. Correct any errors reported, then
960 # restart the resource.
961 scds_syslog -p daemon.err -t $(syslog_tag) -m \
962 "Function: start_sczbt - Running command %s %s failed. Unable to start zone." \
963 "${P2V_SCRIPT}" "${Zonename}"
964 rc_start_command=1
965 return 1
966 fi
967
968 # Only update the file if it is not a symbolic link.
969 # Otherwise it would be a security issue.
970 if [ ! -h ${myplatformfile} ]; then
971 # Add platform to the .platform.orig file
972 echo ${myplatform} >> ${myplatformfile}
973 fi
974 fi
975
976 # Only update the file if it is not a symbolic link.
977 # Otherwise it would be a security issue.
978 if [ ! -h ${Zonepath}/root/.host.orig ]; then
979 # This update is necessary to make sure the
980 # solaris8 or solaris9 zone can get booted without
981 # manual intervention.
982 /usr/bin/hostid > ${Zonepath}/root/.host.orig
983 fi
984 fi
985
986 # boot the zone
987 ${ZONEADM} -z ${Zonename} boot ${Zonebootopt} >>${LOGFILE} 2>&1
988
989 rc_start_command=${?}
990
991 # disable the pmf tag and run a sleep in the background, to assure, that there will be a valid pmftag during the start phase
992
993 START_TIMEOUT=`${SCHA_RESOURCE_GET} -O START_TIMEOUT -R ${RESOURCE} -G ${RESOURCEGROUP}`
994 sleep ${START_TIMEOUT} &
995
996 ${PMFADM} -s ${RESOURCEGROUP},${RESOURCE},0.svc
997
998 # mount the requested loopbakcmount to the local zone
999
1000 if ! lofs_mounts
1001 then
1128 # of
1129 # the
1130 # sczbt
1131 # component.
1132 # @user_action
1133 # None
1134 scds_syslog -p daemon.notice -t $(syslog_tag) -m \
1135 "Function: stop_sczbt - Logical interface %s:%s placed into the global zone" \
1136 "${ADAPTER}" "${i}"
1137 fi
1138 fi
1139 fi
1140 done
1141 done
1142 done
1143 done
1144 fi
1145
1146 # bring down the zone
1147 debug_message "Function: stop_sczbt - Shuting down non-global zone ${Zonename}"
1148 case ${Zonebrand} in
1149 native|solaris8|solaris9)
1150 ${ZLOGIN} ${Zonename} /usr/sbin/shutdown -y -g0 -i0 >${LOGFILE} 2>&1
1151 ;;
1152 lx)
1153 ${ZLOGIN} ${Zonename} /sbin/shutdown -h now >${LOGFILE} 2>&1
1154 ;;
1155 esac
1156
1157 #
1158 # run a test loop to determine if the zone reached state "installed"
1159 # or if the timeout for proper shutdown is exceeded
1160 #
1161 while [ ${SECONDS} -lt ${MAX_STOP_TIMEOUT} ]
1162 do
1163 # check if the zone reached state "installed"
1164 get_zone_state ${Zonename}
1165 debug_message "Function: stop_sczbt - ${Zonename} state is ${ZONE_STATE}, time passed while waiting for shutdown: ${SECONDS}"
1166 if [ "${ZONE_STATE}" = "installed" ]; then
1167 SECONDS=${MAX_STOP_TIMEOUT}
1168 else
1169 # wait 4 seconds
1170 sleep 4
1171 fi
1172 done
1173
1174 #
1175 # bring the zone down at all costs if the shutdown has exceeded
1307 then
1308 rc_check_sczbt=100
1309 debug_message "Function: check_sczbt - ${Zonename} milestone (${Milestone}) state is ${SVC_STATE}"
1310 return ${rc_check_sczbt}
1311 fi;;
1312 lx)
1313 if get_lx_state ${Zonename}
1314 then
1315 if [ "${LX_STATE}" != "${LXrunlevel}" ]
1316 then
1317 rc_check_sczbt=100
1318 debug_message "Function: check_sczbt - ${Zonename} runlevel (${LXrunlevel}) state is ${LX_STATE}"
1319 return ${rc_check_sczbt}
1320 fi
1321 else
1322 rc_check_sczbt=100
1323 debug_message "Function: check_sczbt - runlevel did not return successfully (return code ${rc_get_lx_state}) for the non-global zone {Zonename}"
1324 return ${rc_check_sczbt}
1325 fi;;
1326
1327 solaris8|solaris9)
1328 if get_solaris_legacy_state ${Zonename}
1329 then
1330 if [ "${SOLARIS_LEGACY_STATE}" != "${SLrunlevel}" ]
1331 then
1332 rc_check_sczbt=100
1333 debug_message "Function: check_sczbt - ${Zonename} runlevel (${SLrunlevel}) state is ${SOLARIS_LEGACY_STATE}"
1334 return ${rc_check_sczbt}
1335 fi
1336 else
1337 rc_check_sczbt=100
1338 debug_message "Function: check_sczbt - runlevel did not return successfully (return code ${rc_get_solaris_legacy_state}) for the non-global zone {Zonename}"
1339 return ${rc_check_sczbt}
1340 fi;;
1341 esac
1342
1343 else
1344
1345 # check if the scheduler is running
1346
1347 if ! /bin/pgrep -z ${Zonename} zsched>/dev/null 2>&1
1458 SECONDS=${MAX_PROBE_TIMEOUT}
1459 rc_check_sczbt=0
1460 fi
1461 else
1462 # SCMSGS
1463 # @explanation
1464 # The runlevel command did not run
1465 # successfully in the configured
1466 # non-global zone. The state is
1467 # checked again in 5 seconds.
1468 # @user_action
1469 # None.
1470 scds_syslog -p daemon.err -t $(syslog_tag) -m \
1471 "Function: check_sczbt - runlevel did not run successfully (return code %s) in the non-global zone %s, try again in 5 seconds" \
1472 "${rc_get_lx_state}" "${Zonename}"
1473 rc_check_sczbt=100
1474 sleep 5
1475 fi
1476 done;;
1477
1478 solaris8|solaris9)
1479 while [ ${SECONDS} -lt ${MAX_PROBE_TIMEOUT} ]
1480 do
1481 if get_solaris_legacy_state ${Zonename}
1482 then
1483 if [ "${SOLARIS_LEGACY_STATE}" != "${SLrunlevel}" ]
1484 then
1485 # SCMSGS
1486 # @explanation
1487 # The legacy runlevel is not
1488 # equal to the configured
1489 # SLrunlevel. The state is
1490 # checked again in 5 seconds.
1491 # @user_action
1492 # None.
1493 scds_syslog -p daemon.err -t $(syslog_tag) -m \
1494 "Function: check_sczbt - %s legacy runlevel [%s] not online, runlevel is %s, try again in 5 seconds" \
1495 "${Zonename}" "${SLrunlevel}" "${SOLARIS_LEGACY_STATE}"
1496 rc_check_sczbt=100
1497 sleep 5
1498 else
|