From douglas@douglasthrift.net  Tue Jul 27 10:42:43 2010
Return-Path: <douglas@douglasthrift.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 18B4C1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Jul 2010 10:42:43 +0000 (UTC)
	(envelope-from douglas@douglasthrift.net)
Received: from slowhand.douglasthrift.net (slowhand.douglasthrift.net [69.55.236.40])
	by mx1.freebsd.org (Postfix) with ESMTP id EEE4C8FC1B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Jul 2010 10:42:42 +0000 (UTC)
Received: from localhost (mustang.douglasthrift.net [76.91.0.190])
	(authenticated bits=0)
	by slowhand.douglasthrift.net (8.14.4/8.14.4) with ESMTP id o6RAgbtT098484
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 27 Jul 2010 03:42:42 -0700 (PDT)
	(envelope-from douglas@douglasthrift.net)
Message-Id: <201007271042.o6RAgbtT098484@slowhand.douglasthrift.net>
Date: Tue, 27 Jul 2010 03:42:42 -0700 (PDT)
From: Douglas William Thrift <douglas@douglasthrift.net>
Reply-To: Douglas William Thrift <douglas@douglasthrift.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Patch: service(8) Show rc.d script usage when given just a script name
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         148995
>Category:       bin
>Synopsis:       [patch] service(8): Show rc.d script usage when given just a script name
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 27 10:50:00 UTC 2010
>Closed-Date:    Mon Aug 16 03:37:26 UTC 2010
>Last-Modified:  Mon Aug 16 03:37:26 UTC 2010
>Originator:     Douglas William Thrift
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD backhome.douglasthrift.net 8.1-RELEASE FreeBSD 8.1-RELEASE #5: Sat Jul 24 21:11:20 PDT 2010 root@backhome.douglasthrift.net:/usr/obj/usr/src/sys/SOTIRED i386
>Description:
Currently if service(8) is given just an rc.d script name and no command after,
it prints its own usage message just as if no rc.d script were passed. This
patch changes the behavior so that when just an rc.d script name is given
service(8) runs the rc.d script without arguments which causes the rc.d script
to print its usage.

I find this behavior much more useful than having to type out the full path of
the rc.d script to get its usage message.
>How-To-Repeat:
>Fix:
--- service.patch begins here ---
--- usr.sbin/service/service.sh.orig	2010-07-27 03:29:04.000000000 -0700
+++ usr.sbin/service/service.sh	2010-07-27 03:29:14.000000000 -0700
@@ -98,7 +98,7 @@
 	exit 0
 fi
 
-if [ $# -gt 1 ]; then
+if [ $# -gt 0 ]; then
 	script=$1
 	shift
 else
--- service.patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: vwe 
Responsible-Changed-When: Sun Aug 15 22:04:14 UTC 2010 
Responsible-Changed-Why:  
for maintainer review and handling 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148995 
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Mon Aug 16 03:34:58 UTC 2010 
State-Changed-Why:  

If a user does not input a complete command line to service(8) then 
their purpose is ambiguous. Therefore it's entirely appropriate for 
it to respond with a complete set of suggestions (which includes the 
syntax for rc.d scripts). 

Thanks for your interest in making FreeBSD better, 

Doug 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148995 
>Unformatted:
