OpenOffice daemon para drupal fileframework

exemplo de script:

#!/bin/bash
#
# description: Open Office Service
#
# copie este arquivo para /etc/init.d
# cp ~/soffice-daemon /etc/init.d/soffice-daemon
# torne-o executável
# chmod +x /etc/init.d/soffice-daemon
# altere a propriedade do arquivo para root
# chown -v root:root /etc/init.d/soffice-daemon
# disponilize-o criando links com:
# update-rc.d soffice-daemon defaults
# precisa instalar também o openoffice.org-java-common
# apt-get install openoffice.org-java-common


export WEBUSER=www-data
export PATH=$PATH
export LANG=en_US.UTF-8

start() {
echo -n "Starting OpenOffice service: "
su - $WEBUSER -c "/usr/lib/openoffice/program/soffice -headless -accept='socket,host=127.0.0.1,port=8100;urp' -nofirststartwizard &"
echo "OpenOffice Started"
}

#/opt/openoffice.org3/program/soffice
#/usr/lib/openoffice/program/soffice

#sudo -u $WEBUSER /usr/lib/openoffice/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp" -nofirststartwizard &
#su - $WEBUSER -c "/usr/lib/openoffice/program/soffice -headless -accept='socket,host=127.0.0.1,port=8100;urp' -nofirststartwizard &"


stop() {
echo -n "Stopping soffice: "
pkill soffice
echo "OpenOffice Stopped"
}

case "$1" in
start)
start
;;
stop)
stop
;;
status)
status soffice
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac

exit 0
Comments