11-19-2009 05:24 AM
11-26-2009 04:43 AM
11-27-2009 02:23 AM
#!/bin/bash
if [ "$1" = "-h" ] ; then
echo "syntax: $0 [-a]"
echo " script checks if OpenOffice.org process is still running and throws a"
echo " message when OOo has been terminated, then it exits."
echo " -a : script will run in background and restart OOo process if it"
echo " has been terminated. script has to be killed manually."
echo " -h : shows this little help."
exit 1
fi
function CHECK(){
COUNT=0
while [ $COUNT = 0 ] ; do
if [ ! "`ps aux | grep soffice | grep -v grep | grep -v $0`" = "" ] ; then
# echo " soffice-process alive…"
sleep 5
else
if [ "$1" = "-a" ] ; then
echo "`date +%b` `date +%d` `date +%X` `uname -n` – soffice-process died, restarting it…" >> /var/log/messages
# the following has to be on one line! Change pathes and user to your needs.
su -m 'tomcat6' -c '/usr/lib/openoffice/program/soffice.bin -accept="socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -env:UserInstallation="file:///var/lib/alfresco/oouser" -nologo -headless -nofirststartwizard -nocrashrep -norestore -splash-pipe=5'
# next line *g*
sleep 5
else
echo " soffice-process died."
echo " `date +%X`"
COUNT=1
exit 1
fi
fi
done
}
CHECK $1
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.