From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RnCnt-0007NR-0H for garchives@archives.gentoo.org; Tue, 17 Jan 2012 17:26:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 29588E0B04; Tue, 17 Jan 2012 17:26:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F17BFE0B04 for ; Tue, 17 Jan 2012 17:26:29 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CDF851B404B for ; Tue, 17 Jan 2012 17:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 487F580042 for ; Tue, 17 Jan 2012 17:26:28 +0000 (UTC) From: "Christian Ruppert" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christian Ruppert" Message-ID: <9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41.idl0r@gentoo> Subject: [gentoo-commits] proj/openrc:master commit in: man/, sh/ X-VCS-Repository: proj/openrc X-VCS-Files: man/runscript.8 sh/runscript.sh.in X-VCS-Directories: man/ sh/ X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41 Date: Tue, 17 Jan 2012 17:26:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 50326d0b-0ff0-48e9-aef3-93471f70c369 X-Archives-Hash: 04b143c8ee42bf829c1f970048348747 commit: 9c0edc5c527de01cbe2dccbc7f1a2c571b6acc41 Author: Christian Ruppert gentoo org> AuthorDate: Tue Jan 17 17:23:56 2012 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Tue Jan 17 17:25:44 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3D9c0edc5c Use the "--make-pidfile" when command_background is used The start-stop-daemon "--make-pidfile" option is now used by default when= using command_background, this requires a pidfile to be specified. Document command_background option. Reported-by: Giampaolo Tomassoni tomassoni.biz> X-Gentoo-Bug: 399165 X-Gentoo-Bug-URL: https://bugs.gentoo.org/399165 --- man/runscript.8 | 5 +++++ sh/runscript.sh.in | 6 +++++- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/man/runscript.8 b/man/runscript.8 index dbc0b7d..dd934c4 100644 --- a/man/runscript.8 +++ b/man/runscript.8 @@ -111,6 +111,11 @@ Daemon to start or stop via if no start or stop function is defined by the service. .It Ar command_args List of arguments to pass to the daemon when starting. +.It Ar command_background +Set this to "true", "yes" or "1" (case-insensitive) to force the daemon = into +the background. This implies the "--make-pidfile" and "--pidfile" option= of +.Xr start-stop-daemon 8 +so the pidfile variable must be set. .It Ar pidfile Pidfile to use for the above defined command. .It Ar name diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in index 470f04c..e042be6 100644 --- a/sh/runscript.sh.in +++ b/sh/runscript.sh.in @@ -124,7 +124,11 @@ start() local _background=3D ebegin "Starting ${name:-$RC_SVCNAME}" if yesno "${command_background}"; then - _background=3D"--background --pidfile" + if [ -z "${pidfile}" ]; then + eend 1 "command_background option used but no pidfile specified" + return 1 + fi + _background=3D"--background --make-pidfile --pidfile" fi if yesno "$start_inactive"; then local _inactive=3Dfalse