From owner-freebsd-current@FreeBSD.ORG Thu May 17 21:51:59 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BADB31065672 for ; Thu, 17 May 2012 21:51:59 +0000 (UTC) (envelope-from bryan@shatow.net) Received: from secure.xzibition.com (secure.xzibition.com [173.160.118.92]) by mx1.freebsd.org (Postfix) with ESMTP id 602E78FC12 for ; Thu, 17 May 2012 21:51:59 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=shatow.net; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=sweb; b=FB3cVD YM7b5aaOsTCboTmcaCO5j/DNl7U5pgDtSnFW9r8bmxGiJQBQyQHAxXrVqIqmDDpd 5LYydgyDmMOzOMch2tbdmP/lPARYLkxPri3n8BNGDjZYppAE4+X72Y8SzSjr9XfY tV90mU+ESNjDOD+wsTSYfSLOlUL961yYgP+Bc= DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=shatow.net; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=sweb; bh=riauZD/K3pX1 BRkNTdF48NFUI82rMkWbMca8MwUfKTs=; b=GuAZ2R9ARuHXEmJg9RBeOanFyWVl sxkuZUqo9uywFgCdwBk2FyQNyeD5i5tWI19WCxU40+H0BQMYybY2/JF5WCdNJINB tjyGdDLaP335+x4gujfHjcSWJXvZgC/ze3FYRODXgPXtOR+o3hH7CMco3eWuZOTg lKjebSL85dRVVoU= Received: (qmail 55613 invoked from network); 17 May 2012 16:51:52 -0500 Received: from unknown (HELO ?10.10.1.87?) (bryan@shatow.net@10.10.1.87) by sweb.xzibition.com with ESMTPA; 17 May 2012 16:51:52 -0500 Message-ID: <4FB572F5.4070801@shatow.net> Date: Thu, 17 May 2012 16:51:49 -0500 From: Bryan Drewery User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Doug Barton References: <4FAF291C.8090401@shatow.net> <4FB04084.5070202@FreeBSD.org> <4FB10A1B.7090102@shatow.net> <4FB56F8C.2000304@FreeBSD.org> In-Reply-To: <4FB56F8C.2000304@FreeBSD.org> X-Enigmail-Version: 1.4.1 OpenPGP: id=3C9B0CF9; url=http://www.shatow.net/bryan/bryan.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: [review request] usr.sbin/service - make showing files configurable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 21:51:59 -0000 On 5/17/2012 4:37 PM, Doug Barton wrote: > On 05/14/2012 06:35, Bryan Drewery wrote: > > >> On 5/13/2012 6:15 PM, Doug Barton wrote: >>> On 5/12/2012 8:23 PM, Bryan Drewery wrote: >>>> Hi, >>>> >>>> I found service(8) to be inconsistent that it listed files with >>>> `service -e`, but plain services with `service -l` > >>> That behavior is by design. > > > >> Could you please elaborate on the design decision? > > For services that are enabled (IOW, a tiny subset of the overall > number) I thought it was useful to indicate to the user where those > services come from. The -l option dumps everything in the directories, > even if it's not a service. Users interested in differentiating > /etc/rc.d from $local_startup can use ls. Thanks for explaining. > >> I did of course look in base for uses of service -e and service >> -l, before considering this patch. The only case I can find is in a >> cshrc example, which my patch does not affect. > > That's not relevant, as you cannot possibly know what other uses > service(1) is being put to. Also, it's bad form to change the default > output of a tool (and/or the semantics of its command line options) > years after its introduction. True. > >> I had expected service -e to behave like service -l, so I could >> for example, put it into a loop and check all services, using the >> service(8) script itself. > >> for service_name in `service -e`; do service status $service_name >> || service start $service_name; done > > for service in `service -e` ; do > service ${##*/service} status || service ${##*/service} start > done Yes, I resorted to that before the patch. I just think consistency is better. > > (Note, your syntax for the service command is wrong above.) Yeah it's what I get for mashing a pseudo example up and not testing it! > > > hth, > > Doug > Thank you, Bryan Drewery