Monday, February 28, 2011

Install headless OpenOffice.org on Ubuntu 10.04.2

I needed this for an Alfresco Community Edition installation, so ..here are the steps:

1. install the necessary packages:
apt-get install openoffice.org-writer openoffice.org-calc openoffice.org-draw \
openoffice.org-impress openoffice.org-java-common openoffice.org-headless


2. create the init script:
nano /etc/init.d/openoffice

fill it with:
#!/bin/bash
# openoffice.org headless server script
#
# chkconfig: 2345 80 30
# description: headless openoffice server script
# processname: openoffice
#
# Author: Vic Vijayakumar
# Modified by Federico Ch. Tomasczik
#
OOo_HOME=/usr/bin
SOFFICE_PATH=$OOo_HOME/soffice
PIDFILE=/var/run/openoffice-server.pid
set -e
case "$1" in
start)
if [ -f $PIDFILE ]; then
echo "OpenOffice headless server has already started."
sleep 5
exit
fi
echo "Starting OpenOffice headless server"
$SOFFICE_PATH -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1
touch $PIDFILE
;;
stop)
if [ -f $PIDFILE ]; then
echo "Stopping OpenOffice headless server."
killall -9 soffice && killall -9 soffice.bin
rm -f $PIDFILE
exit
fi
echo "Openoffice headless server is not running."
exit
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0


3. make the script executable:
chmod 755 /etc/init.d/openoffice


4. make it start at common runlevels:
update-rc.d openoffice defaults


That's all folks :)

1 comment:

  1. I want to install OpenOffice on my laptop, thanks guide download, and install OpenOffice it.

    ReplyDelete