kedar writes:
> One of the issues I am seeing is currently, I make sure
> that SMF is available by seeing that the OS is Solaris 10.
> (In Java, we do System.getProperty("os.name")).

Ick.

> This is rather fragile, because the "minimum" platform required
> is Solaris 10. But this technique fails for OpenSolaris and Solaris
> Express. Sure, I can code it that way, but I'd like to see
> if SMF support is available as a more direct interface.
> 
> What should I be using?

I'd use:

        if [ -x /usr/sbin/svcadm ]; then
                # SMF is present
        else
                # SMF is not present
        fi

In other words, test for the feature you actually want, rather than
some unrelated artifact of the system, such as the kernel's version
number.

(Not sure what the Java equivalent would be, but there ought to be
one.)

-- 
James Carlson, Solaris Networking              <james.d.carlson at sun.com>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

Reply via email to