Re: [review request] usr.sbin/service - make showing files
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
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
討論串 (同標題文章)
完整討論串 (本文為第 5 之 5 篇):