#!/bin/ksh93 . /lib/svc/share/smf_include.sh [[ -z ${SMF_FMRI} ]] && SMF_FMRI='svc:/network/ipmievd2:default' IPMIEVD='@CLIENT_BASEDIR@/sbin/ipmievd2' IPMIEVD_OPTIONS='sel' if (( $# == 0 )); then # No arguments provided - report current status (use "-c" option to # svcprop to get the current properties, otherwise false will result) X=${ /usr/bin/svcprop -c -p general/enabled ${SMF_FMRI} } || \ exit ${SMF_EXIT_ERR_NOSMF} [[ $X == 'true' ]] && print "${SMF_FMRI} is enabled" \ || print "${SMF_FMRI} is disabled" exit ${SMF_EXIT_OK} fi case "$1" in 'start') # If there is a BMC interface, use this, the default (openIPMI) # otherwise. [[ -c /dev/bmc ]] && IPMIEVD+=" -I bmc" # Another lazy program, which just checks, whether the pidfile exists, # and not, whether there is actually a process running with this PID. # So we need to do it ... PIDFILE="/system/volatile/${SMF_FMRI##*/}.pid" if [[ -r ${PIDFILE} ]]; then PID=$(<${PIDFILE}) if [[ -n ${PID} ]]; then kill -0 ${PID} || rm -f ${PIDFILE} fi fi IPMIEVD_OPTIONS+=" pidfile=${PIDFILE}" ${IPMIEVD} ${IPMIEVD_OPTIONS} || { print "WARNING: start '${IPMIEVD}' failed: exit status $?" exit ${SMF_EXIT_ERR_FATAL} } ;; *) print "Usage: $0 start" exit 1 ;; esac exit ${SMF_EXIT_OK}