From owner-freebsd-current@FreeBSD.ORG Thu May 17 21:37:17 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 7D7751065670 for ; Thu, 17 May 2012 21:37:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 06A441A9048; Thu, 17 May 2012 21:37:16 +0000 (UTC) Message-ID: <4FB56F8C.2000304@FreeBSD.org> Date: Thu, 17 May 2012 14:37:16 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120506 Thunderbird/12.0.1 MIME-Version: 1.0 To: Bryan Drewery References: <4FAF291C.8090401@shatow.net> <4FB04084.5070202@FreeBSD.org> <4FB10A1B.7090102@shatow.net> In-Reply-To: <4FB10A1B.7090102@shatow.net> X-Enigmail-Version: 1.5pre OpenPGP: id=1A1ABC84 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:37:17 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 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. > 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. > 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 (Note, your syntax for the service command is wrong above.) hth, Doug - -- This .signature sanitized for your protection -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJPtW+MAAoJEFzGhvEaGryEpokH/RbWnJZN/RCQzidxoIbAx0+5 nAEX33e0Iazfqs/km7uFP8T/4SD2b0pOmr3dNBaKHqnpz005ACzhTcWD111ik/d2 ypRKdzh+vlq+Y9bDB4PozMjnalZrhkAUIinUIDDH6xMW46fIbN2bXPqz8AIe1Umo a8LaHW59ARJf197o7iyWNOYOcF6+S3haaSzu8UXL5MTDtKBpn5XY5Eg6ppc/ZD9J Mzaq1k7baCrGqCSsyZusmCv7WWDcOw7tOspUKzoNMm+wBMf7MrQyPUQsaA9vfGXZ cB39Byryvi9Rhbz/ACjgw44ZRVUcjWJaxkFVc5WwkLbCDTv4tny5q2KpIAHfhPk= =ykfV -----END PGP SIGNATURE-----