Open IT Experts for Enterprise

Zylk empresa de desarrollo de ecommerce

Watching your Libreoffice process for Alfresco transformations

Cesar Capillas
Cesar Capillas
Libre Office

Libreoffice watchdog addon and useful scripts &tips

A usual question of final users is that their Office files are not
being previsualized in Alfresco. This may be for some reasons like:
 1. The office file is corrupted
 2. The office mimetype is not set correctly
 3. The office file is too big
 4. The Libreoffice process is not responding
In the last case, you will see that new MS-Office and Office
documents are not being previsualized (any of them). In that cases,
the first thing you should do is to check the Libreoffice process, by
default in 8100 port:
$ ps aux | grep soffice
If this process does not exist, or it seems to have problems, the
manual solution is to restart Libreoffice just with a simply:
$ALF_HOME/alfresco.sh start libreoffice
Sometimes it is necessary to kill the pid of the Libreoffice
process, previously.
But there are better alternatives for the Alfresco admin. The first
one is based on a nice plugin and a quartz job:
where you can define the corresponding cronjob in alfresco-global.properties
contentreich.officeWatchDog.kill=true
contentreich.officeWatchDog.cronExpression=0 */10 * * * ?
contentreich.officeWatchDog.timeoutSeconds=60
Another simple solution is check_libre.sh script
in the crontab:
#! /bin/bash
# m h  dom mon dow   command
#0,15,30,45 * * * * /opt/alfresco/bin/check_libre.sh
ALF_HOME=/opt/alfresco
ALF_EXE=$ALF_HOME/alfresco.sh
ALF_LOG=$ALF_HOME/tomcat/logs/libreffice.log
ALF_DATE=`/bin/date`
if [[ -z `/bin/pidof ".soffice.bin"` ]]
 then
  $ALF_EXE start libreoffice
  echo "$ALF_DATE" >> $ALF_LOG
fi
The log will help you to track if you have many problems with
Alfresco transformations and OODirect subsystem. If this happens,
consider to have memory enough for the soffice process.
You can also use the next script for reference for starting Libreoffice:
And finally, in Enterprise Edition (although in this case, it is
tracked via Jodconverter subsystem) you can also restart the
Libreoffice subsystem via JMX, or to set multiple instances to
jodconverter via Admin Console.
NOTE: In Alfresco 5.1.e you need to change alfresco.sh to the
correct location of libreoffice script (assuming an installation
with the linux installer and including libreoffice). Anyway you can
always run:
$ cd /opt/alfresco51e/libreoffice/scripts$ 
$ sh libreoffice_ctl.sh start
libreoffice_ctl.sh : libreoffice started at port 8100
In alfresco.sh change:
#LIBREOFFICE_SCRIPT=$INSTALLDIR/libreoffice/scripts/ctl.sh
LIBREOFFICE_SCRIPT=$INSTALLDIR/libreoffice/scripts/libreoffice_ctl.sh
Also the libreoffice_ctl.sh script needs to remove the
slashes. Check this:
NOTE II: In Ubuntu you may also need:
$ sudo apt-get install libice6 libsm6 libxt6 libxrender1 libfontconfig1 libcups2 libxinerama1 libglu1-mesa

Si te ha parecido interesante comparte este post en RRS

Facebook
LinkedIn
Telegram
Email

Leer más sobre temas relacionados

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *