#!/bin/sh # Startup script for soffice # # chkconfig: 2345 75 35 # description: Run soffice in server mode # Source function library. . /etc/rc.d/init.d/functions SOFFICE=/opt/openoffice.org2.4/program/soffice [ -f $SOFFICE ] || exit 0 prog="soffice" LOCKFILE=/var/lock/subsys/$prog USER=apache unset DISPLAY start() { umask 2 echo -n $"Starting $prog: " runuser -s /bin/bash -c "$SOFFICE '-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager' -norestore -nofirststartwizard -nologo -headless" $USER & # daemon --user $USER $SOFFICE "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -norestore -nofirststartwizard -nologo -headless & RETVAL=$? touch $LOCKFILE echo return $RETVAL } stop() { echo -n $"Stopping $prog: " killall -u $USER -q soffice echo RETVAL=$? rm -f $LOCKFILE return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status soffice ;; restart) stop start ;; condrestart) if [ -f $LOCKFILE ]; then stop start fi ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL