bin/148995: Patch: service(8) Show rc.d script usage when given just a script name

Douglas William Thrift douglas at douglasthrift.net
Tue Jul 27 10:50:01 UTC 2010


>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:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 27 10:50:00 UTC 2010
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:


More information about the freebsd-bugs mailing list