[Bug 190793] New: Some rc scripts return non zero status on success

bz-noreply at freebsd.org bz-noreply at freebsd.org
Sun Jun 8 14:35:24 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190793

            Bug ID: 190793
           Summary: Some rc scripts return non zero status on success
           Product: Base System
           Version: 10.0-STABLE
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: conf
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: belzebubc at gmail.com

Created attachment 143528
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=143528&action=edit
remove "[ foo ] && bar" hack

Rc scripts (/etc/rc.d/*) is written to return status returned by the last
executed command. This is correct behavior, but it cause problems with
construction like this:

[ -n "${foo}" ] && echo '.'

This construction may return 1 and if it is the last command, whole script
return 1. This behavior was certainly not intended, I guess. So construction
above should  be changed into correcrt form:

if [ -n "${foo}" ]; then
   echo '.'
fi

I find this bug in /etc/rc.d/routing, but more scripts are affected. Situation
when bug appear depends on configuration of services. Patch removing this hack
from all scripts is attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list