From owner-freebsd-current@FreeBSD.ORG Mon May 14 13:35:32 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 C1D681065673 for ; Mon, 14 May 2012 13:35:32 +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 66F298FC17 for ; Mon, 14 May 2012 13:35:32 +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=XbnslI bAfLale6JdtvIf8xnYdgDsHY6Xg0VNNcoItlyLjDvidX1aEtKtaTR34sWYqK6eDF 6LmhLCFyCOLxswQxGdbpgAg3cbErtajw1XI7iJ/6Wsp0XctWjtF4yA85t8n0ez2e qtIBwXbyFQAg6s+of200F7NCwqexdQsgusQuw= 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=Mddf0u5a2vBC yOUySP2ehdOK2WY5qfPlUoJy2Qw/UVk=; b=djyxwHPUlShv4NG5qg758PGSGZeF FajuPttzpJSzVyAQlbf10fOINEbt1u3jXAQLVM+gd8SHVguU3HDk1V5iUWLtAJiR MfWtA2LbGiGHSPFn3c3o8GupdTurQ0/rKmlGpz1CTE1FvnD7b+lCMPLxZkmbFzqS XDWv5csDw0FGSy0= Received: (qmail 99693 invoked from network); 14 May 2012 08:35:24 -0500 Received: from unknown (HELO ?10.10.1.87?) (bryan@shatow.net@10.10.1.87) by sweb.xzibition.com with ESMTPA; 14 May 2012 08:35:24 -0500 Message-ID: <4FB10A1B.7090102@shatow.net> Date: Mon, 14 May 2012 08:35:23 -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> In-Reply-To: <4FB04084.5070202@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: Mon, 14 May 2012 13:35:32 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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? 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. 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 Of course this doesn't work as -e returns files. /etc/rc.d/ntpd does not exist in /etc/rc.d or the local startup directories (/usr/local/etc/rc.d) This may be a poor example, but it's something I tried and was surprised by not working. My patch allows for the old behavior of listing the file, but improves it so now -e -l and -r all support showing files by specifying -F, while without, it just lists the service names. I consider this change to be fairly trivial since -e doesn't appear to be used anywhere currently. > Thanks for your interest, > > Doug > Regards, Bryan Drewery -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJPsQobAAoJEG54KsA8mwz55UcP/3m/6JnfNauEBr4/YB+fClyq 0+q6qkZIue7iXvZKxbE86Zyg4PxBMEvsteVrqZHSwSbwJmvrRj8o1aQkKS2FDgjW 0urKhNnzY2nd5cgDfE9HLSsg9gm25KWbVEcPKNhY5ru8BltRaLQ4V5XGu5XIsxYM E2660rX71q1+GgjuU4TqKUj3m/PjNeAw37uwJTvhmWwP2EK8Aw3zOfipQAsYo4ng ehha1gG0y6fqK44hlgr/SByiGmcN2+5OxCFQp/GFCwvVjXIUTnMN0xLs77GN1/S6 P4yMz6bE605uEaHQfbyPminfE/5t5Zisr9ctk4Vckwj+ixHetcVEa692NXGb5YwP +WygJ6HJk7pwJnQwjFwXUSKJSA/Iy0ktXBaJDawLZWAKl2CuADq9H6fnOqdTJWF2 tgXYufvuWNzCmdfW+kOuDbzUxcUcK/GMN5y4z41Ee245h/GQ5otECD/lybeBwnZF S90Hpc8nuctedDw5GuisQMBNNOfctdl/gRL+zmLIEDD7lzO90bz6bJlUMZt2Umzq 1vou2brIpMqmN+ci1PMSpXRIRufXSHOAPRzfPOORYZWb7t51C173YjwFt6Zkk6nt WKXVQzM9oArfClAUilVbiqlq4PSMVh/9iCTZSsNrNWRiPjIpapxAIlXg/idgxTZA YX6eL2j3vXWahCP0PKtP =woA8 -----END PGP SIGNATURE-----