Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Jun 2014 14:35:23 +0000
From:      bz-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 190793] New: Some rc scripts return non zero status on success
Message-ID:  <bug-190793-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: belzebubc@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.



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