From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4A16813826A for ; Tue, 24 May 2016 16:43:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B5270141F3; Tue, 24 May 2016 16:43:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 04492141F3 for ; Tue, 24 May 2016 16:43:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 19336340961 for ; Tue, 24 May 2016 16:43:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 31347976 for ; Tue, 24 May 2016 16:43:25 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1463698780.3351c8b4c3027f09003f8ba33e43f46762f5c453.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/supervise-daemon.sh X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 3351c8b4c3027f09003f8ba33e43f46762f5c453 X-VCS-Branch: master Date: Tue, 24 May 2016 16:43:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 52d7ec06-9d07-4d32-8273-2810a2e85b7a X-Archives-Hash: 5b26049382566c38e84d4dc311df5aad commit: 3351c8b4c3027f09003f8ba33e43f46762f5c453 Author: William Hubbs gmail com> AuthorDate: Thu May 19 22:59:40 2016 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu May 19 22:59:40 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=3351c8b4 supervise-daemon.sh: add support for chroot variable sh/supervise-daemon.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sh/supervise-daemon.sh b/sh/supervise-daemon.sh index 34e3ef7..2d889a6 100644 --- a/sh/supervise-daemon.sh +++ b/sh/supervise-daemon.sh @@ -20,24 +20,30 @@ supervise_start() ebegin "Starting ${name:-$RC_SVCNAME}" eval supervise-daemon --start \ + ${chroot:+--chroot} $chroot \ ${pidfile:+--pidfile} $pidfile \ ${command_user+--user} $command_user \ $supervise_daemon_args \ $command \ -- $command_args $command_args_foreground rc=$? - [ -n "${pidfile}" ] && service_set_value "pidfile" "${pidfile}" + if [ $rc = 0 ]; then + [ -n "${chroot}" ] && service_set_value "chroot" "${chroot}" + [ -n "${pidfile}" ] && service_set_value "pidfile" "${pidfile}" + fi eend $rc "failed to start $RC_SVCNAME" } supervise_stop() { + local startchroot="$(service_get_value "chroot")" local startpidfile="$(service_get_value "pidfile")" + chroot="${startchroot:-$chroot}" pidfile="${startpidfile:-$pidfile}" [ -n "$pidfile" ] || return 0 ebegin "Stopping ${name:-$RC_SVCNAME}" supervise-daemon --stop \ - ${pidfile:+--pidfile} $pidfile \ + ${pidfile:+--pidfile} $chroot$pidfile \ ${stopsig:+--signal} $stopsig eend $? "Failed to stop $RC_SVCNAME"