Implementing under Ubuntu 14.04 - Openoffice headless?? LibreOffice?

Hi,

I succeded in installing Openvpms 1.7 under Ubuntu 14.04 LTS server with A Kubuntu GUI and logged into a copy of my database successfully.

I was ,however,unable to understand how to implement the headless version of OpenOffice and also I recall spying a note that the headless version isnt needed? Also LibreOffice has replaced OpenOffice and implementing it from the repositories seemed a bit dodgy throwing a few errors (probably due to removing LibreOffice) but it did install and open.

Although I have opted out on Linux for now (as I ran out of time and took the quick option and upgraded to Windows 7 and Openvpms 1.7) could someone advise re the need for headless Open office or not and whether LibreOffice is an option. I was very close to running under Linux though I have yet to tackle the printers so perhaps I was still a way off.

Cheers Geoff

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

I have just recently implemented OpenVPMS 1.7 on a headless Ubuntu 14.04 server.  I did wind up ultimately using OpenOffice rather than LibreOffice, however, as I was having trouble getting around a couple of issues. One issue was that LO was taking up to three minutes to print a document (and I'm not sure that this wasn't a printer issue) but the other was that LO was pegging the CPU at nearly 100%.  I'm sure that these issues are resolvable, but with OO, everything just seemed to work.

I took the approach of starting OO at boot from my own script, and have a modified version of openvpms-reports.xml that Tim A. kindly provided, that prevents OpenVPMS from trying to start OO on its own. This works quite well. And as you can still use LO on any of the other network computers, I didn't see that using OO on the server as any big loss.  It doesn't have to do much, and so if it is not upgraded as often as LO would be from the repositories, I'm not really concerned.

If you are interested in pursuing the Linux installation, I can heartily recommend it.  I have put together a rather detailed step-by-step guide (not quite ready for prime-time) but one that you might find useful nonetheless.  Also, if you're interested, I could provide a VirtualBox appliance that you could install that has the server, OO, OpenVPMS, and a staff training version of OpenVPMS already running. 

As for the printers, I had no problems at all once I worked out my networking issues (wireless printer).  I suspect that may have been the source of my 3-minute print problem.

Let me know if I can be of any assistance.

Sam Longiaru 

 

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

Sam - I would be interested in your guide as to how you got oo or libreoffice headless working with OpenVPMS on Ubuntu.

Cheers,

Cahir

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

Hi Cahir,

Very sorry for not getting back to you sooner but for some reason new posts have stopped coming to my mailbox so I tend to miss them.  I'll dig into it.

I have attached my draft installation guide for OVPMS 1.7 on a Ubuntu 14.04 server.  I started to update it for 1.8 (but it is not complete) as I had to do a few things differently for 1.8.

1) I installed Java 8 in anticipation of the 1.9 requirement

2) I manually installed the latest Tomcat7 as the Ubuntu repositories did not have the version stated in the OVPMS install notes to be required for Java 8.  I installed into /opt/local/ as opposed to /var/lib/ as done by the apt-get installer. 

3) In 1.8, openvpms-reports.xml now includes options for starting OpenOffice on boot.  This is the approach I use.  Documents print immediately. In my original 1.7 install, I had to use a start-up script and make the changes documented in the installation guide.  It's now easier in 1.8.

While I have attached the entire guide (still a work in progress) take a look at Section 3, starting on page 14.  You've probably sorted everything out by now, but if not, maybe this will help.   

Sam

 

AttachmentSize
IT-installation.odt 165.24 KB

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

Hi Tim and Cahir,

I have found installing libreoffice 4.3 as per

sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice

and then adding a simple upstart script in /etc/init/openoffice.conf

# openoffice
start on runlevel [2345]
stop on runlevel [016]
respawn
expect fork
exec /usr/bin/soffice --headless --nologo --nofirststartwizard --accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1

and removing the openvpms restart of openoffice as per Tim's document, works very well.  

Hope this helps.

Cheers Tony

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

Just a follow up comment - this script runs as root....once we add the scripts to kill non blocking tasks this will need to be adjusted so it runs as a the same user as tomcat.  

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

I am having an issue with LibreOFFICE file generation - its running pretty slow 

I am using a script started version and connecting using the Pool settings from Openvpms-reports.xml

However I have tried using tomcat/openvpms to start libreoffice as well.

 

 It can take around 180 sec to generate a letter doc file from template and if I refresh the document it takes the same again.

Its running on a 3.0ghz processor with 8gb of memory (6gb is free) mysql uses 1gb and tomcat can use up to 2gb but usually sits around 700mb .

 Once the doc hits cups it prints fast so the slowdown is definitely Libreoffice.

I have checked the following logs and found no error messages 

/var/log/tomcat7/catalina.out
/var/log/tomcat7/openvpms-full.log
/var/log/syslog
/var/log/dmesg
/var/log/kernlog
/var/log/auth.log

I have also tried running office as tomcat7 and root which made no difference.

Anyone got any tips ?

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

You could try resetting the LibreOffice profile: https://wiki.documentfoundation.org/UserProfile

Also see: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1366519

Sometimes you can track down the cause of these issues with strace

 

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

From the looks of the Strace.log its sending the file in 8bit pieces through the socket...and its incredibly slow... while strace would probably slow it by a factor of 3 its still taking 3-5minutes without strace engaged.

The entire strace.log I recorded to do 1 file was 2gb in size...

 

20009 15:13:27.338205 recvfrom(24, "\200\0\0\0\0\0\0\254i", 9, 0, NULL, NULL) = 9
20009 15:13:27.338254 futex(0x7f0008002764, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0008002790, 1290 <unfinished ...>
20010 15:13:27.338279 <... futex resumed> ) = 0
20009 15:13:27.338290 <... futex resumed> ) = 1
20010 15:13:27.338301 futex(0x7f0008002790, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
20009 15:13:27.338311 futex(0x7f0008002790, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
20010 15:13:27.338322 <... futex resumed> ) = -1 EAGAIN (Resource temporarily unavailable)
20009 15:13:27.338333 <... futex resumed> ) = 0
20010 15:13:27.338343 futex(0x7f0008002790, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
20009 15:13:27.338353 recvfrom(24,  <unfinished ...>
20010 15:13:27.338363 <... futex resumed> ) = 0
20010 15:13:27.338390 futex(0x7f0014001b64, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0014001b90, 1308) = 1
20008 15:13:27.338419 <... futex resumed> ) = 0
20010 15:13:27.338430 futex(0x7f0008002764, FUTEX_WAIT_PRIVATE, 1291, NULL <unfinished ...>
20008 15:13:27.338442 futex(0x7f0014001b90, FUTEX_WAKE_PRIVATE, 1) = 0
20008 15:13:27.338488 sendto(24, "\0\0\0\4\0\0\0\1\4\0\377\377", 12, 0, NULL, 0) = 12
20008 15:13:27.338528 futex(0x7f0014001b64, FUTEX_WAIT_PRIVATE, 1309, NULL <unfinished ...>
20009 15:13:27.338561 <... recvfrom resumed> "\0\0\0\t\0\0\0\1", 8, 0, NULL, NULL) = 8
20009 15:13:27.338591 recvfrom(24, "\200\0\0\0\0\0\0\254i", 9, 0, NULL, NULL) = 9
20009 15:13:27.338639 futex(0x7f0008002764, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0008002790, 1292) = 1
20010 15:13:27.338667 <... futex resumed> ) = 0
20009 15:13:27.338679 recvfrom(24,  <unfinished ...>
20010 15:13:27.338689 futex(0x7f0008002790, FUTEX_WAKE_PRIVATE, 1) = 0
20010 15:13:27.338736 futex(0x7f0014001b64, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0014001b90, 1310) = 1
20008 15:13:27.338763 <... futex resumed> ) = 0
20010 15:13:27.338775 futex(0x7f0008002764, FUTEX_WAIT_PRIVATE, 1293, NULL <unfinished ...>
20008 15:13:27.338790 futex(0x7f0014001b90, FUTEX_WAKE_PRIVATE, 1) = 0
20008 15:13:27.338836 sendto(24, "\0\0\0\4\0\0\0\1\4\0\377\377", 12, 0, NULL, 0) = 12
20008 15:13:27.338877 futex(0x7f0014001b64, FUTEX_WAIT_PRIVATE, 1311, NULL <unfinished ...>
20009 15:13:27.338902 <... recvfrom resumed> "\0\0\0\t\0\0\0\1", 8, 0, NULL, NULL) = 8
20009 15:13:27.338932 recvfrom(24, "\200\0\0\0\0\0\0\254i", 9, 0, NULL, NULL) = 9
20009 15:13:27.338980 futex(0x7f0008002764, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0008002790, 1294) = 1
20010 15:13:27.339008 <... futex resumed> ) = 0
20009 15:13:27.339019 recvfrom(24,  <unfinished ...>
20010 15:13:27.339029 futex(0x7f0008002790, FUTEX_WAKE_PRIVATE, 1) = 0
20010 15:13:27.339076 futex(0x7f0014001b64, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0014001b90, 1312) = 1
20008 15:13:27.339108 <... futex resumed> ) = 0
20010 15:13:27.339120 futex(0x7f0008002764, FUTEX_WAIT_PRIVATE, 1295, NULL <unfinished ...>
20008 15:13:27.339130 futex(0x7f0014001b90, FUTEX_WAKE_PRIVATE, 1) = 0
20008 15:13:27.339175 sendto(24, "\0\0\0\4\0\0\0\1\4\0\377\377", 12, 0, NULL, 0) = 12
20008 15:13:27.339216 futex(0x7f0014001b64, FUTEX_WAIT_PRIVATE, 1313, NULL <unfinished ...>
20009 15:13:27.339249 <... recvfrom resumed> "\0\0\0\t\0\0\0\1", 8, 0, NULL, NULL) = 8
20009 15:13:27.339278 recvfrom(24, "\200\0\0\0\0\0\0\254i", 9, 0, NULL, NULL) = 9
20009 15:13:27.339325 futex(0x7f0008002764, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0008002790, 1296) = 1
20010 15:13:27.339353 <... futex resumed> ) = 0
20009 15:13:27.339365 recvfrom(24,  <unfinished ...>
20010 15:13:27.339375 futex(0x7f0008002790, FUTEX_WAKE_PRIVATE, 1) = 0
20010 15:13:27.339423 futex(0x7f0014001b64, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0014001b90, 1314) = 1
20008 15:13:27.339455 <... futex resumed> ) = 0
20010 15:13:27.339466 futex(0x7f0008002764, FUTEX_WAIT_PRIVATE, 1297, NULL <unfinished ...>
20008 15:13:27.339476 futex(0x7f0014001b90, FUTEX_WAKE_PRIVATE, 1) = 0
20008 15:13:27.339522 sendto(24, "\0\0\0\4\0\0\0\1\4\0\377\377", 12, 0, NULL, 0) = 12
20008 15:13:27.339561 futex(0x7f0014001b64, FUTEX_WAIT_PRIVATE, 1315, NULL <unfinished ...>
20009 15:13:27.339594 <... recvfrom resumed> "\0\0\0\t\0\0\0\1", 8, 0, NULL, NULL) = 8
20009 15:13:27.339623 recvfrom(24, "\200\0\0\0\0\0\0\254i", 9, 0, NULL, NULL) = 9
20009 15:13:27.339670 futex(0x7f0008002764, FUTEX_CMP_REQUEUE_PRIVATE, 1, 2147483647, 0x7f0008002790, 1298) = 1
20010 15:13:27.339698 <... futex resumed> ) = 0
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

I am wondering about this

https://superuser.com/questions/860321/linux-localhost-sockets-painfully...

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

The related link https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=74332 adds a:

tcpNoDelay=1

to the connection string. The followup post indicates this has been fixed in LibreOffice: https://gerrit.libreoffice.org/#/c/13856/

So you could:

  • get the latest LibreOffice
  • use OpenOffice
  • change OOSocketBootstrapService to supply tcpNoDelay=1

 

Re: Implementing under Ubuntu 14.04 - Openoffice headless?? ...

Sadly I can confirm that switching to OpenOFFICE fixes the issue.  

using openoffice you can change the .conf file to be 

exec /usr/bin/soffice -headless -nologo -nofirststartwizard -accept="socket,host=127.0.0.1,port=8100;urp"

 

 
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content