Hi, quick article about real time problem. The quick intro:
There is the Solaris non-global zone, to be Radius server.
The freeradius was installed from Sunfreeware, and integrated into Solaris service framework.
So the problem is that when non-global zone reboots, somehow the radius service doesn't start.
Yes we can troubleshoot, but let's for this excersise create the RC script that check/fix the radius service when system boots.
The fix script is /etc/init.d/check_radius_service
#!/bin/sh
#set -x
# wait for - minutes
sleep 60
# subroutines
progress() {
for i in F I X R A D I U S
do
echo "${i}\c"
sleep 1
done
}
notifyme() {
echo "The ${SERVICE} will be disabled/enabled" \
| mailx -s "The ${SERVICE} isn't online after non-global zone ${ZONE} rebooted" ${ADMIN}
}
notifymeagain() {
echo "Attempt to enable ${SERVICE} has failed" \
| mailx -s "${SERVICE} cannot be enabled, check it manually" ${ADMIN}
}
ZONE=`hostname`
ADMIN=admin@mydomain.ca
SERVICE=radius
STATUS=`svcs -H ${SERVICE} | awk '{print $1}'`
# if service is not online, send email and disable/enable service
if [ ${STATUS} = online ]; then
exit 0
else
notifyme
/usr/sbin/svcadm disable ${SERVICE}
progress
#progress | tee -a /dev/console
/usr/sbin/svcadm enable -r ${SERVICE}
fi
# check service status again
sleep 5
[ `svcs -H ${SERVICE} | awk '{print $1}'` != online ] && notifymeagain
exit 0
|