From owner-svn-src-head@FreeBSD.ORG Tue Jul 15 19:15:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACC486AB; Tue, 15 Jul 2014 19:15:59 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A78AA29DA; Tue, 15 Jul 2014 19:15:58 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id x13so6082724wgg.19 for ; Tue, 15 Jul 2014 12:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wgLwoefbKD5gxba7guuie9hXn1td4BwJrJWZwLsN41g=; b=xTB/7lsKlG7Djd7kJyfnZTVxiv8+ATv1HDg2JsvpzPH9TnFh8FOGtj0R/ltaFZxDTp 784reLeS5GfmrhHd9GrXrx8e4QDDziBlAM9PZcHr/YBtcwmuQ8htgb1onyrIR0H9/cr9 gJ5UNpANcHKVJtDiVCCUtUG4ec8sAfo462kLT3EMCKDlrlETN9uEKRZxJLb7KYVTXzZn /KZ6GTtwD8ZBB96m0MgrYVNLajjeZ/LhDzgqUDDW9Ax2IyOm7OVFFe4hRB/XqGAM5AJb /Dqi3eKrPmIJtXF6yl9if0fWKLX/2jh05dj+zqh74u0yhvxrIHE0FO2qQ0HO1XxSTdsv ExUw== X-Received: by 10.180.21.200 with SMTP id x8mr7829338wie.67.1405451756855; Tue, 15 Jul 2014 12:15:56 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id n2sm34474138wjf.40.2014.07.15.12.15.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Jul 2014 12:15:56 -0700 (PDT) Date: Tue, 15 Jul 2014 21:15:53 +0200 From: Mateusz Guzik To: Bryan Drewery Subject: Re: svn commit: r268641 - head/usr.sbin/service Message-ID: <20140715191553.GA31990@dft-labs.eu> References: <201407150218.s6F2Itj8044531@svn.freebsd.org> <53C56BE9.9050304@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <53C56BE9.9050304@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Devin Teske , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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: Tue, 15 Jul 2014 19:15:59 -0000 On Tue, Jul 15, 2014 at 12:59:05PM -0500, Bryan Drewery wrote: > On 7/14/2014 9:18 PM, Devin Teske wrote: > > Author: dteske > > Date: Tue Jul 15 02:18:55 2014 > > New Revision: 268641 > > URL: http://svnweb.freebsd.org/changeset/base/268641 > > > > Log: > > Fix an issue with service(8) where utilities such as screen(1) and tmux(1) > > would behave differently when utilizing rc-script was invoked manually vs. > > service(8). The issue being that these utilities require the TERM environ > > variable to be set and service(8) was not passing it down. > > > > Reported by: Michael Dexter > > PR: bin/191869 > > Reviewed by: allanjude > > MFC after: 3 days > > X-MFC-to: stable/10, stable/9 > > > > Modified: > > head/usr.sbin/service/service.sh > > > > Modified: head/usr.sbin/service/service.sh > > ============================================================================== > > --- head/usr.sbin/service/service.sh Tue Jul 15 01:03:29 2014 (r268640) > > +++ head/usr.sbin/service/service.sh Tue Jul 15 02:18:55 2014 (r268641) > > @@ -139,7 +139,7 @@ cd / > > for dir in /etc/rc.d $local_startup; do > > if [ -x "$dir/$script" ]; then > > [ -n "$VERBOSE" ] && echo "$script is located in $dir" > > - exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $* > > + exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin TERM="$TERM" $dir/$script $* > > fi > > done > > > > > > Hm, I'm not sure about this. The "behaves differently" is exactly the > reason for service(8). It runs with a clean environment such as the boot > does. Running an rc script without service(8) will give wrong behavior > in many scripts that do not match boot-time behavior. > Indeed, the whole point is to NOT inherit anything from calling process. > As far as I can tell, TERM is not set on boot. So the rc script would > also not work on boot. So this change is wrong. > Yes, but maybe there is a sensible default that could be used? Alternatively, one would have to fixup rc scripts using tmux to do what's best for them. Either, the change as it is looks wrong. Please revert for the time being. -- Mateusz Guzik