#
# "$Id: ec_backends.method 1101 2008-10-17 18:13:31Z elkner $"
#
# description:
#
NAME="EduComponents Backend "
SPOOLER_FMRI='svc:/application/ec/spooler:default'
USE_RCTL='true'
export USE_RCTL
# Read command line arguments
BACKEND_NAME="$2"
echo "Usage: $0 {start|status|stop} instance BackendName"
}
if [ -z "$BACKEND_NAME" ]; then
echo "Missing BackendName - exiting"
exit $SMF_EXIT_ERR_FATAL
fi
# Set defaults; SMF_FMRI should have been set, but just in case.
if [ -z "$SMF_FMRI" ]; then
if [ -z "$instance" ]; then
exit $SMF_EXIT_ERR_NOSMF
fi
SMF_FMRI="svc:/application/ec/backend:${instance}"
fi
BACKENDCTL="${VAL}/bin/backendctl"
else
exit $SMF_EXIT_ERR_CONFIG
fi
cmdopts=""
fi
fi
fi
fi
fi
fi
else
echo "WARNING: property 'options/port' of $SPOOLER_FMRI is not set!"
fi
fi
cmdopts="${cmdopts} -d "
fi
fi
fi
fi
fi
fi
fi
fi
}
if [ ! -x "${BACKENDCTL}" ]; then
echo "${BACKENDCTL} does not exist"
exit $SMF_EXIT_ERR_FATAL
fi
echo "Starting $NAME $BACKEND_NAME ... \c"
echo "${BACKENDCTL} ${cmdopts} $BACKEND_NAME start"
ST=$?
echo 'failed.'
exit $ST
else
echo 'done.'
fi
;;
stop)
echo "Stopping $NAME $BACKEND_NAME ... \c"
if [ $? -eq 0 ]; then
echo 'done.'
else
echo 'failed.'
exit $SMF_EXIT_ERR_OTHER
fi
;;
;;
*)
exit $SMF_EXIT_ERR_FATAL
;;
esac
exit $SMF_EXIT_OK