Libreoffice daemon in rc script does not work (shell expansion problem)

Jose Garcia Juanino jjuanino at
Sun Mar 25 18:22:47 UTC 2012


I am trying to make an rc script to start libreoffice daemon. The aim is
convert Open Document files to PDF, HTML and TXT.

The script is the following:


# PROVIDE: libreoffice
# REQUIRE: LOGIN cleanvar usr
# KEYWORD: shutdown

. /etc/rc.subr

command_args="-p $pidfile"
command_args="$command_args ${soffice_path}/${name}"
command_args="$command_args '--accept=socket,host=golem,port=8100,tcpNoDelay=1;urp'"
command_args="$command_args --nologo --headless --nofirststartwizard --invisible"
command_args="$command_args --nolockcheck --norestore"
    # kill first child process
    pkill -P `cat $pidfile`

load_rc_config $name
run_rc_command "$1"

This script works nicely, and starts libreoffice as a root daemon. But
I need to start it as another user (svn), thus I comment out the line


After that, something weird happens with then internal expasion in rc
functions, and I get:

# service soffice restart
Starting soffice.
Syntax error: Unterminated quoted string
eval: urp --nologo --headless --nofirststartwizard --invisible --nolockcheck --norestore": not found
/usr/local/etc/rc.d/soffice: WARNING: failed to start soffice

I am unable to fix this... I am trying escaping quotes, using
backslashes, etc.

Any advice will be wellcome.

Best regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list