>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 haveto use a bash script to do this. This one is configured for
Linux Redhat/Centos to run from cron (you can change the binary paths for
other distros). Specifically, this is will kill 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.
Luckily, the 'parent' OpenOffice processes are owned by the root user
in my case. If the processes you need to kill are the same ownership as
the 'parent' OpenOffice processes you will need to add an extra step to
the pipe. (filtering out commands with 'ServiceManager' might to the
trick)
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'
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]