Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2014 17:23:23 GMT
From:      Frederic Culot <culot@FreeBSD.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/187118: service(8): inaccurate error message
Message-ID:  <201402271723.s1RHNNqt039843@freefall.freebsd.org>
Resent-Message-ID: <201402271730.s1RHU1CA040528@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         187118
>Category:       bin
>Synopsis:       service(8): inaccurate error message
>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:   Thu Feb 27 17:30:01 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Frederic Culot
>Release:        FreeBSD 11.0-CURRENT amd64
>Organization:
FreeBSD
>Environment:
System: FreeBSD freefall.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r259961: Fri Dec 27 21:56:39 UTC 2013 peter@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL amd64
>Description:
service(8) checks if the given script exists and is executable before
proceeding (using the -x condition evaluation operator), and issues an
error if one of those conditions is not met. The issue is that the
error message is not accurate, telling only that the given script does
not exist. However, it might be that a user started developing a startup
script and forgot to switch on its execution flag. He might end up
wondering why service(8) reports that his script is missing while in
fact the only issue is that it is not executable.
The attached patch tries to clarify the error message reported by
service(8).

>How-To-Repeat:
  # $EDITOR /etc/rc.d/my_startup_script
  # service my_startup_script start

  my_startup_script does not exist in /etc/rc.d or the local startup
  directories (/usr/local/etc/rc.d)

>Fix:
--- service.patch begins here ---
--- /usr/sbin/service	2014-02-01 11:08:51.792862305 +0100
+++ service	2014-02-27 17:03:29.220048128 +0100
@@ -145,5 +145,5 @@
 
 # If the script was not found
 echo "$script does not exist in /etc/rc.d or the local startup"
-echo "directories (${local_startup})"
+echo "directories (${local_startup}), or is not executable"
 exit 1
--- service.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402271723.s1RHNNqt039843>