20101116

OpenOffice server startup script

A Google search about “OpenOffice server daemon” led me to some interesting readings:

  • http://sourceforge.net/projects/oodaemon/ : (September 2009) “Open Office Server Daemon based on older daemon written in python (oood). Open Office is unstable as a server (memory leaks, not multithreaded, …), this daemon makes it working in long-term without having to change anything in your code.” (readme <http://oodaemon.sourceforge.net/README.html>)
  • Chapter 46 of the Nuxeo Reference Guide is a good documentation of the topic. It mentions and refers to an oooctl control script included with Nuxeo.

However this script is for OOo before 2.3 (still uses Xvfb). I removed the Xvfb parts and also the automagic search for the SOFFICE binary and include it to the Lino repository as /bash/oood (TODO: But what about the copyright notice?)

Some more readings:

Now finally here is how to do it:

# cp /var/snapshots/lino/bash/oood /etc/init.d
# chmod 755 /etc/init.d/oood
# update-rc.d oood defaults
update-rc.d: warning: /etc/init.d/oood missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/oood ...
   /etc/rc0.d/K20oood -> ../init.d/oood
   /etc/rc1.d/K20oood -> ../init.d/oood
   /etc/rc6.d/K20oood -> ../init.d/oood
   /etc/rc2.d/S20oood -> ../init.d/oood
   /etc/rc3.d/S20oood -> ../init.d/oood
   /etc/rc4.d/S20oood -> ../init.d/oood
   /etc/rc5.d/S20oood -> ../init.d/oood

Added these instructions to /admin/install.

(TODO: How to LSBize an Init Script)

Miscellaneous changes

  • trying to print contract #1 produced “Exception: Build method u’appypdf’ doesn’t exist.”. This was because appy.pod couldn’t be imported after upgrade to 0.6.0. lino.thanks_to() now displays appy.pod also when not installed.

  • bug fixed: Print Button in Detail view of a slave report didn’t set the correct mk. For example in ContractsByPerson it used the primary key of the current Contract.

  • bug fixed: when calling “print” from Detail view, the fmt:print parameter was stored as base parameter, causing subsequent navigation buttons to fail.

  • Updated release 0.8.12 in Eupen and marked repository as hg tag -f v0.8.12.

  • A first known (and now fixed) bug in the above release ist that the following new feature didn’t yet work at all: “Contracts are now mostly read-only when they have been printed (Contract.disabled_fields). The flag must_build ist set to False after the first build (PrintAction.get_target_url).”

    Now it works basically, but the calling grid or detail view doesn’t get refreshed after printing or saving, so it won’t have the correct must_build flag and disabled_fields.

OpenOffice server startup script continued

More reading about this topic:

The script by Vic Vijayakumar & Federico Ch. Tomasczik uses a (pseudo) PID file but has no restart option, while Florent Guillaume’s script uses another method (ps axw) but has a restart option.

I noticed that the ps axw method didn’t work for me, made more tests and modifications to /bash/oood. This script is still not optimal: we should make it LSB-compliant.

On Debian Lenny, OOo is < 2.3, so it seems to me that installing manually a recent copy is at least okay.

I’ll better wait a bit before writing documentation about all this, since things are moving there (LibreOffice is coming, Debian will make new releases,…)

Miscellaneous

  • I changed the method for finding primary key of previous/next records (needed to fill out navinfo) in elem2rec_detailed Later this turned out to be much quicker on reports with over thousand records.

  • bugfix: user and CoachesByPerson where missing. dsbe.Person has now a 6th Detail layout.

  • bugfix: the combobox for city didn’t work. choosers on ForeignKey fields now have automatically instance_values set to True,

  • bugfix: Lino ignored an explicit width for an image (e.g. image:12) in .dtl files.

  • Picture distortion problem is maybe solved. Introduced new LayoutElement.hflex which is False for PictureElements.

  • extra row should be really empty. but grid columns with an xtype of datecolumn or booleancolumn override my renderer. maybe the server should return a really empty extra row? No, much easier: in lino.css I define font color as white intead of italic:

    .lino-phantom-row td {
        /* font-style: italic; */
        color:white;
    }
    
  • Detail window now has a Refresh button.

Last check-in for today at 01:34