Watching your Libreoffice process for Alfresco transformations

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/ 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
contentreich.officeWatchDog.cronExpression=0 */10 * * * ?
Another simple solution is script in the crontab:
#! /bin/bash
# m h  dom mon dow   command
#0,15,30,45 * * * * /opt/alfresco/bin/
if [[ -z `/bin/pidof ".soffice.bin"` ]]
  $ALF_EXE start libreoffice
  echo "$ALF_DATE" >> $ALF_LOG
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 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 start : libreoffice started at port 8100
In change:
Also the 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

More Blog Entries


1 Comment

Douglas C. R. Paes Douglas C. R. Paes 2 Years Ago



One more test that has proved to be good is also try the following to check if you can reach to the LibreOffice service.

telnet localhost 8100


In my case, that revealed a network config error (name resolution), and once I got that fixed, I could connect to LibreOffice.