#!/usr/sbin/sh
#
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Academic Free License version 2.1
#
. /lib/svc/share/smf_include.sh
case "$1" in
'start')
if smf_is_nonglobalzone; then
smf_method_exit $SMF_EXIT_TEMP_DISABLE local_zone \
"$SMF_FMRI is not supported in a local zone"
fi
[ ! -x /usr/lib/hal/hald ] && exit $SMF_EXIT_ERR_CONFIG
[ ! -d $SMF_SYSVOL_FS/hald ] && /usr/bin/mkdir -m 755 $SMF_SYSVOL_FS/hald
[ ! -d /media ] && /usr/bin/mkdir -m 755 /media
/usr/lib/hal/hald --daemon=yes
err=$?
if [ $err -ne 0 ]; then
echo "hal failed to start: error $err"
exit $SMF_EXIT_ERR_FATAL
fi
;;
*)
echo "Usage: $0 { start }"
exit $SMF_EXIT_ERR_FATAL
;;
esac
exit $SMF_EXIT_OK