#!/usr/sbin/sh # # Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. # . /lib/svc/share/smf_include.sh # Current database version, defined in dlmgmtd DB_VERSION=1 case "$1" in 'start') if smf_is_nonglobalzone; then # # Check the dlmgmtd/dbversion property and see if an upgrade # of datalink.conf is needed. The current DB version is 1 # with the merged repository from Highlander. This check and # private dladm command is for non-global zones only. In # global zones, the upgrade is handled directly by the dlmgmtd # daemon. # ver=`/usr/bin/svcprop -cp dlmgmtd/dbversion $SMF_FMRI 2>/dev/null` [ $? -eq 1 ] && ver=0 if [ "$ver" != "$DB_VERSION" ]; then /usr/sbin/dladm upgrade-zone $ver if [ $? -eq 0 ]; then /usr/sbin/svccfg -s $SMF_FMRI \ addpg dlmgmtd application 2>/dev/null /usr/sbin/svccfg -s $SMF_FMRI setprop \ dlmgmtd/dbversion = integer: $DB_VERSION fi fi # # The daemon is not started in a non-global zone. We use # this return value to notify the smf infrastructure that # there are no running processes associated with this # online, non-transient service. # smf_method_exit $SMF_EXIT_TEMP_TRANSIENT non_global_zone \ "$SMF_FMRI does nothing in non-global zones" fi # Start the dlmgmtd daemon. /usr/sbin/dlmgmtd if [ $? = 0 ]; then exit $SMF_EXIT_OK else exit $SMF_EXIT_ERR_FATAL fi ;; esac