0

I am trying to run LibreOffice as a service on a CentOS 7 server.

Here's my /etc/systemd/system/soffice.service file:

[Unit]
Description=OpenOffice service
After=network.target

[Service]
ExecStart=/usr/bin/soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard
Restart=always
KillSignal=SIGQUIT
Type=simple
StandardError=syslog
NotifyAccess=all
User=root

[Install]
WantedBy=multi-user.target

The service seems to start correctly:

● soffice.service - OpenOffice service
   Loaded: loaded (/etc/systemd/system/soffice.service; disabled; vendor preset: disabled)
   Active: active (running) since mer 2019-01-09 10:29:01 CET; 4s ago
 Main PID: 11648 (oosplash)
   CGroup: /system.slice/soffice.service
           ├─11648 /usr/lib64/libreoffice/program/oosplash --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststart...
           └─11665 /usr/lib64/libreoffice/program/soffice.bin --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirstst...

gen 09 10:29:01 dev-srv-03 systemd[1]: Unit soffice.service entered failed state.
gen 09 10:29:01 dev-srv-03 systemd[1]: soffice.service failed.
gen 09 10:29:01 dev-srv-03 systemd[1]: Started OpenOffice service.
gen 09 10:29:01 dev-srv-03 systemd[1]: Starting OpenOffice service...

but if I try and have a look at listening services with a simple netstat -an | grep 8100, nothing's going on.

Instead, if I run the ExecStart command exactly as it is in the shell (/usr/bin/soffice --headless --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard), netstat -an | grep 8100 returns:

tcp        0      0 127.0.0.1:8100          0.0.0.0:*               LISTEN

Am I missing something here? Thank you.

closed as off-topic by Jeff Schaller, Christopher, A.B, Stephen Harris, Anthony Geoghegan Jan 11 at 10:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, Christopher, A.B, Stephen Harris, Anthony Geoghegan
If this question can be reworded to fit the rules in the help center, please edit the question.

  • There is a very similar question here on serverfault - serverfault.com/questions/753819/… - Have you tried to use the parameters of that question when starting your service? – nwildner Jan 9 at 10:24
  • @nwildner yes, I've read that. If you compare the configs, you'll see I've already added the proposed fix (Type=simple in place of Type=notify) and the rest is identical. – Seether Jan 9 at 10:36
  • Ok, I noticed my parameters in the ExecStart have a different placement for the apostrophe. Also, the other question was using a different port (8101 rather than 8100). Combining their syntax with my port seems to work. Thank you for your time @nwildner – Seether Jan 9 at 10:40
  • 1
    Yeah, maybe i didn't make myself clear. Not only the Type= systemd parameter but the entire ExecStart= line, and all its nuances with apostrophes and parameters :) Anyway, I'm glad it worked and you noticed the issue with your command line. – nwildner Jan 9 at 10:44