>I'm always getting a DisposedException Error. If I move
>aBean.stopOOoConnection() down further, after xDesktop.terminate(), no
>exception arises anymore. But the processes soffice.bin and soffice.exe
>are still running.
Sadly, I am having to use a bash script to do this. The one is configured
for
Linux Redhat/Centos to run from cron (you can chanage the binary paths for
other
distros). Specifically, this is for killing soffice.bin binaries left over
from a web
application that converts word docs to HTML. The process takes well under
a minute, so a 10 minute buffer is safe, after 25 minutes, stubborn
processes
are sent the SIGKILL signal.
It requires the 'procfs' virtual file system so it couldn't be ported to
WinXX,
you would need another solution under Windows. However, just about any
other OS supports procfs so this could probably be easily ported to Solaris
etc...
Change PUSER, PMATCH, MINUTES and KMINUTES to suit your needs, then
add this to cron.
--Dave
#!/bin/bash
# this script is meant to be called regularly from cron and
# will kill old OpenOffice processes owned by tomcat
# owner of the processes to kill
PUSER=tomcat
# grep match of processes
PMATCH='soffice\.bin'
# minutes to send normal termination signal
MINUTES=10
# for hung processes, minutes to wait before sending KILL signal
KMINUTES=25
# normal termination
/usr/bin/find /proc/ \
-maxdepth 3 \
-name 'cmdline' \
-user ${PUSER} \
-mmin +${MINUTES} \
-exec /bin/grep -l ${PMATCH} {} \; | \
/bin/cut -d'/' -f3 | \
/usr/bin/xargs -n1 -i^ /bin/bash -c '/bin/kill ^ 2>&1 >
/dev/null'
# wait a little longer then KILL hung processes
/usr/bin/find /proc/ \
-maxdepth 3 \
-name 'cmdline' \
-user ${PUSER} \
-mmin +${KMINUTES} \
-exec /bin/grep -l ${PMATCH} {} \; | \
/bin/cut -d'/' -f3 | \
/usr/bin/xargs -n1 -i^ /bin/bash -c '/bin/kill -9 ^ 2>&1 >
/dev/null'
--
View this message in context:
http://old.nabble.com/OOoBean-and-XDesktop%3A%3Aterminate%28%29-tp25854078p26157760.html
Sent from the openoffice - api dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]