#!/usr/sbin/sh # # Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. # . /lib/svc/share/smf_include.sh . /lib/svc/share/net_include.sh # # In a shared-IP zone we need this service to be up, but all of the work # it tries to do is irrelevant (and will actually lead to the service # failing if we try to do it), so just bail out. # In the global zone and exclusive-IP zones we proceed. # smf_configure_ip || exit $SMF_EXIT_OK case "$1" in start) state=`$IPADM show-if -p -o state lo0 2>/dev/null` res=$? if [[ "$state" = "disabled" ]]; then $IPADM enable-if -t lo0 elif [[ $res -ne 0 ]]; then # # If the loopback interface does not exist, we need to create # the interface and the IPv4 and IPv6 loopback addresses. # # IPv4 loopback $IPADM create-addr -T static -a 127.0.0.1/8 lo0/v4 # IPv6 loopback $IPADM create-addr -T static -a ::1/128 lo0/v6 fi # Trusted Extensions shares the loopback interface. # The all-zones prop is non-persistent so that a TX system # can be easily configured back to a standard Solaris system. if (smf_is_system_labeled); then if smf_is_globalzone; then $IPADM set-addrprop -t -p zone=all-zones lo0/v4 $IPADM set-addrprop -t -p zone=all-zones lo0/v6 fi fi ;; *) echo "Usage: $0 { start }" exit 1 ;; esac exit $SMF_EXIT_OK