Installation | Topics | Beyond Lino

More about the LibreOffice service

As we mentioned in Set up a Lino production server, A Lino server must have a LibreOffice (LO) service when at least one Lino site of a server uses lino_xl.lib.appypod.

getlino configure installs a LibreOffice service when the option --appy is specified.

When multiple Lino sites on a same server use lino_xl.lib.appypod, only one LO service is needed.

The LO service is implemented as a supervisor config file named /etc/supervisor/conf.d/libreoffice.conf with the following content:

# generated by getlino
[program:libreoffice]
command = libreoffice --accept="socket,host=127.0.0.1,port=8100;urp;" --nologo --headless --nofirststartwizard
umask = 0002

A Lino site with lino_xl.lib.appypod remains functional even when the service is down because the service is needed only when a user actually requests to print a document using the appypdf, appydoc or appyrtf methods.

It is possible that these printing methods are used only sporadically and that nobody complains when they fail… until the moment when they are urgently needed.

That’s why getlino installs a hourly cronjob /etc/cron.hourly/healthcheck that tests (among others) whether the LO service is running

Background information

The remaining information on this page is needed only when something doesn’t work as expected.

The lino_xl.lib.appypod plugin uses appy.pod, which in turn uses python3-uno to connect to a LibreOffice server.

appy.pod is part of the appy Python package and was automatically installed together with Lino into your Python environment.

The appy Python package requires two system packages libreoffice and python3-uno, which must be installed like this:

$ sudo apt-get install libreoffice python3-uno

Then you need to run a LO server. For occasional or experimental usage you can fire it up manually using something like this:

$ libreoffice '--accept=socket,host=127.0.0.1,port=8100;urp;'

You can kill this process using Ctrl-C. Having libreoffice running like this can cause another (desktop) libreoffice process to fail.

But for regular usage and especially on a production server you will want to use a startup script. The following is what getlino configure does automatically when you invoke it as root and when you specify the –appy option.

  • Install the Supervisor package:

    $ sudo apt-get install supervisor
    

    Note that the supervisor package is being installed system-wide, it is not related to any specific project.

  • Create a file libreoffice.conf in /etc/supervisor/conf.d/ with this content:

    [program:libreoffice]
    command=libreoffice --accept="socket,host=127.0.0.1,port=8100;urp;" --nologo --headless --nofirststartwizard
    user = root
    umask = 0002
    
  • Restart supervisord:

    $ sudo service supervisor restart
    
  • Have a look at the log files in /var/log/supervisor and check the status:

    $ sudo service supervisor status