not able to start xvfb service via rc script

Hi ,

I am having this start script to start xvfb under rc3.d but it fails during system startup saying unable to open display. also manually if i try to execute the script , it does not work. But if i execute what ever is there in the script line by line on my SHELL , it starts well.

Please help me out

 
#!/sbin/sh
#+---------------------------------------------------+
#| /etc/init.d/Xvfb
#+---------------------------------------------------+
# Start Virtual frame buffer
RDN=`uname -n`
FQDN=`nslookup $RDN | grep Name | awk '{print $NF}'`
export RDN FQDN
DISPLAY=":1"
export DISPLAY
case "$1" in
start)
        /usr/openwin/bin/Xvfb :1 screen 0 1152x900x8 &
        /usr/openwin/bin/xhost +
        /usr/openwin/bin/twm -display ${FQDN}:1.0 &

        ;;
stop)
        ;;
*)
        echo $"Usage: $prog {start|stop}"
        exit 1
        ;;
esac
exit

I am using solaris 10 .

Error:

 
/usr/openwin/bin/twm:  unable to open display "test.sol.box:1.0"

if you logged as regular user then did su and login to root do exit from root and become regular user again

script runs as root user