From owner-freebsd-questions@FreeBSD.ORG Sun Mar 25 18:22:47 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55FF0106566B for ; Sun, 25 Mar 2012 18:22:47 +0000 (UTC) (envelope-from jjuanino@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id D419E8FC16 for ; Sun, 25 Mar 2012 18:22:46 +0000 (UTC) Received: by wern13 with SMTP id n13so4971128wer.13 for ; Sun, 25 Mar 2012 11:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:x-operating-system:user-agent; bh=MCFg/vE3unR/tjOsNGA19pl3Vy6Y1Yic6KNNvc1WoXc=; b=Yk7/88c3wIAuer2VxO964u9ImTco8UBna7jLb0zk8OdBZ9Qai5udDS4zfkoJGjxlfc k4t5qwhOe7mi05PgYvNd6SNIc6pq//1AXnHaHFZ/ycOFjioF1DdYspsFlHbTY/r1Hlm4 3zl4Pu/H0PMXlFFtPlTClZQk2aYgg7VewFYwxCcVCd4vZeWwf8HKowxq7whQ3hPzmX4I gcgvg6BSrylQsJDmEffWPjx59tlwDwpaAnpcagUCBTMSYtpxh3K/s2G19v9SvqRN21hs E0OqCHH7zMyfEsqhSj2CCRfJ0Kq++pC5dOlFIcnxN0AZMTtjMOy5evly/6ZOz8/bRryT jh1g== Received: by 10.180.14.230 with SMTP id s6mr12457971wic.2.1332699765767; Sun, 25 Mar 2012 11:22:45 -0700 (PDT) Received: from banach (248.Red-79-157-77.dynamicIP.rima-tde.net. [79.157.77.248]) by mx.google.com with ESMTPS id k7sm55792209wia.5.2012.03.25.11.22.44 (version=SSLv3 cipher=OTHER); Sun, 25 Mar 2012 11:22:44 -0700 (PDT) Date: Sun, 25 Mar 2012 20:22:39 +0200 From: Jose Garcia Juanino To: freebsd-questions@freebsd.org Message-ID: <20120325182238.GA25193@banach> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline X-Operating-System: FreeBSD 9.0-RELEASE User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Libreoffice daemon in rc script does not work (shell expansion problem) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2012 18:22:47 -0000 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, 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: #!/bin/sh # # PROVIDE: libreoffice # REQUIRE: LOGIN cleanvar usr # KEYWORD: shutdown . /etc/rc.subr soffice_path="/usr/local/lib/libreoffice/program" name="soffice" #soffice_user="svn" procname="${soffice_path}/oosplash.bin" rcvar=`set_rcvar` pidfile="/var/run/${name}.pid" command="/usr/sbin/daemon" 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" stop_precmd="${name}_prestop" soffice_prestop(){ # 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 #soffice_user="svn" 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 --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9vYm4ACgkQFOo0zaS9RnJfrwCfQva5RNANuXk+DrWlyFOfLX3o C7MAn3KjEJzim+6/cN7GfZ00iuhEj2H9 =GSmd -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND--