How to use LibreOffice with --headless option?

If I try to execute /Applications/ --headless
by a user not logged in, e.g. _lp, the program exits with the message
No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting

What to do?

Don’t have Mac and I don’t use LO in headless mode, but maybe this could point you in right direction: How do I run LibreOffice --headles on Mac […]?

Hi, I know that this question is kind of old but still without a solution here.

Short: I just created a shell file with:

exec /Applications/ "$@"

You can check the same problem with a complete answer here