Install and run OpenOffice as service on centos
Install OpenOffice command line
yum install libreoffice-base yum install libreoffice-writer yum install libreoffice-headless
Test the install success or not by using command. (to stop the command press ctrl +c)
soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard
Open other console and run:
telnet localhost 8100
Setup openoffice as service
create /etc/init.d/soffice
#!/bin/bash # chkconfig: 345 20 80 # description: init.d script for headless openoffice.org # # processname: soffice # # source function library . /etc/rc.d/init.d/functions RETVAL=0 SOFFICE_PATH='/usr/lib64/libreoffice/program' SOFFICE_ARGS='--accept="socket,host=localhost,port=8100;urp" --headless' SOFFICE_PIDFILE=/var/run/soffice.bin.pid start_soffice() { echo -n $"Starting OpenOffice.org" daemon $SOFFICE_PATH/soffice.bin $SOFFICE_ARGS & [ $? -eq 0 ] && echo_success || echo_failure pidof soffice.bin > $SOFFICE_PIDFILE echo } start() { start_soffice } stop() { echo -n $"Stopping OpenOffice" killproc soffice.bin echo } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" esac
5.)
root $ chmod +x /etc/init.d/soffice
root $ chkconfig –add soffice
root $ chkconfig soffice on
root $ service soffice start