LibreOffice headless service usually down on CentOS, how to keep it running?

I installed LibreOffice headless on my CentOS as document preview for Liferay portal. It listen on port 8100 but it usually disappear and need to restart in again with

#soffice --headless --accept="socket,host=,port=8100;urp;" --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --invisible &

Open in new window

Any method to keep in running?
Sida SayInfrastructure EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nociSoftware EngineerCommented:
If used this way it will run until you log out that session.
To keep it running i suggest you make it a service and build this command into  a script that is run during bootup of the system.
It depends on the CentOS version how to do it. CentOS 7  uses systemd, i have no idea how it should be resolved there as i consider systemd infant technology and don't deploy it until it matures a lot.

For previous versions a script like:


case $1 in
 nohup /usr/bin/soffice --headless --accept="socket,host=,port=8100;urp;" --nodefault \
      --nofirststartwizard --nolockcheck --nologo --norestore \
      --invisible &
   echo please use start or stop as parameter.
exit 0
is a very basic way to start it.
This needs to be activated as service:
Save it as /etc/init.d/soffice-headless

then do:
  chkconfig --add soffice-headless --level 345

more fancy script can be made that auto configure for chkconfig, or have better error handling.
Gerwin Jansen, EE MVETopic Advisor Commented:
Add nohup before your soffice command.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sida SayInfrastructure EngineerAuthor Commented:
Thank you all, but I want to know what no hub mean?
Gerwin Jansen, EE MVETopic Advisor Commented:
nohup means 'no hangup' - this means that the  started process will not exit when the terminal or session is exited/killed. If your process generates output on the screen, you should add a redirect to catch that output. At end of your command line add:

>> /path/output.log
Sida SayInfrastructure EngineerAuthor Commented:
Thank @Gerwin Jansen,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.