From owner-svn-src-head@FreeBSD.ORG Sun Dec 20 07:30:38 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1BD11065679 for ; Sun, 20 Dec 2009 07:30:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0EBD98FC19 for ; Sun, 20 Dec 2009 07:30:38 +0000 (UTC) Received: (qmail 18185 invoked by uid 399); 20 Dec 2009 07:30:37 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 20 Dec 2009 07:30:37 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B2DD2A1.8060907@FreeBSD.org> Date: Sat, 19 Dec 2009 23:30:41 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Hajimu UMEMOTO References: <200912200134.nBK1YCAA048942@svn.freebsd.org> <4B2DBB51.9060002@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: multipart/mixed; boundary="------------020409080105060805010202" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 07:30:38 -0000 This is a multi-part message in MIME format. --------------020409080105060805010202 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I've reattached your original patch and included the freebsd-rc list. Hajimu UMEMOTO wrote: > Hi, > >>>>>> On Sat, 19 Dec 2009 21:51:13 -0800 >>>>>> Doug Barton said: > > dougb> Other than the removal of "exit $?" I'm not necessarily opposed to > dougb> that idea, but I'm wondering what value this change would have in the > dougb> "system is already up and running" case (when it will be executed) vs. > dougb> at boot time (such as in /etc/rc where the code is copied from). > > I don't just remove "exit $?". Since the script is kicked by "exec", > the return value from the script is returned to the process which > kicked service(8), directly. Good point, I did not read your patch carefully enough, sorry. > About the value this change, I think it should be same as the values > at boot time. I cannot imagine that someone want to restart the > system daemons under the user environment. I can actually, especially for ports. > Even if someone want to do > so, he still can kick /etc/rc.d/foo, directly. The point of adding a service(8) is to avoid needing to do that. :) > Further, it seems service(8) does similar thing on CentOS. I've already made one too-hasty comment on your suggestion, so I will take a step back and let other's chime in. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ --------------020409080105060805010202 Content-Type: text/plain; name="service-env.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="service-env.diff" Index: usr.sbin/service/service.sh diff -u usr.sbin/service/service.sh.orig usr.sbin/service/service.sh --- usr.sbin/service/service.sh.orig 2009-12-20 13:14:14.000000000 +0900 +++ usr.sbin/service/service.sh 2009-12-20 13:17:44.420246627 +0900 @@ -106,11 +106,15 @@ exit 1 fi +HOME=/ +PATH=/sbin:/bin:/usr/sbin:/usr/bin +export HOME PATH +cd $HOME + for dir in /etc/rc.d $local_startup; do if [ -x "$dir/$script" ]; then [ -n "$VERBOSE" ] && echo "$script is located in $dir" - $dir/$script $* - exit $? + exec env -i HOME=$HOME PATH=$PATH $dir/$script $* fi done --------------020409080105060805010202--