Hi,
I’m trying to launch OpenOffice.org when our server boots. So I created a StartupItem that will launch OOo and Xvfb (OOo needs a X-Server even when it is launched as headless). I also added a DISPLAY environment variable in the script, but when the script is launched, only Xvfb start. It seems that the problem is that OOo don’t see the DISPLAY variable and don’t launch since it can’t find the display name.
The script is like this :
#!/bin/sh
. /etc/rc.common
StartService ()
{
if [ -f “/usr/X11R6/bin/Xvfb” ]; then
ConsoleMessage “Starting Xvfb”
/usr/X11R6/bin/Xvfb :1 -screen 0 800x600x8 &
export DISPLAY=:1
fi
sleep 5
if [ -f “/Applications/OpenOffice.org\ 2.0.app/Contents/MacOS/program/soffice” ]; then
ConsoleMessage “Starting OpenOffice”
/Applications/OpenOffice.org\ 2.0.app/Contents/MacOS/program/soffice “-accept=socket,host=localhost,port=8100;urp” -headless -display:1 &
fi
}
DISPLAY=:1; export DISPLAY
RunService “$1”
Do I need to do something special so that environment variable can be set and see ? We are still on 10.3.9, so I cannot use launchd.