+++ This bug was initially created as a clone of Bug #171052 +++ Description of problem: The /lib/lsb/init-functions file (both on Fedora Core and RHEL4 / RHEL5 Beta) uses alias to attempt to set up lsb init script support functions such as log_success_msg and log_failure_msg. Unfortunately, /lib/lsb/init-functions wrongly uses alias for this purpose, despite the fact that neither Bash (http://www.gnu.org/software/bash/manual/bashref.html#SEC79) nor the Posix standard (see http://www.opengroup.org/onlinepubs/009695399/utilities/alias.html) shell by default will expand aliases during non-interactive shell script processing. The /lib/lsb/init-functions file needs to be rewritten to define the commands as true shell functions, and not aliases. Version-Release number of selected component (if applicable): redhat-lsb-3.1-11 How reproducible: 100% Steps to Reproduce: 1. Install Xen for RHEL5 (or any package using lsb init functions) 2. run /etc/init.d/xendomains status (or any init script using lsb init functions) Actual results: # /etc/init.d/xendomains status Checking for xendomains:/etc/init.d/xendomains: line 69: log_failure_msg: command not found Expected results: correct invocation of the /etc/init.d/functions success function by xendomains script. Output should be: # /etc/init.d/xendomains status Checking for xendomains: [FAILED] with no domains configured/running, or: # /etc/init.d/xendomains status Checking for xendomains: v1 [ OK ] If there are some xen auto domains configured & running. Additional info: The Fedora bug this was cloned from has been sitting in NEW for over a year (bug was filed against lsb rather than redhat-lsb).
Created attachment 142310 [details] convert aliases to functions in /lib/lsb/init-functions A simple patch is attached that replaces the alias definitions with true functions. This was tested with /etc/init.d/xendomains and works - this seems to be the only initscript in RHEL that uses the lsb definitions so this should be a fairly low-risk change.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux major release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Major release. This request is not yet committed for inclusion.
Thanks for the bug report. Patch has been applied and built into redhat-lsb-3.1-12.src.rpm under RHEL5-branch.
Thanks - tested with redhat-lsb-3.1-12.1.i386.rpm and now works fine with the stock xendomains script.
Fix in redhat-lsb-3.1-12.
Shouldn't those shell functions pass arguments down to what they are executing? I.e. have "$@" at the end?
Created attachment 142821 [details] convert aliases to functions in /lib/lsb/init-functions Yes, they should: revised patch attached with this correction.
Patch revised in redhat-lsb-3.1-12.2.EL. Thanks.
*** Bug 218989 has been marked as a duplicate of this bug. ***
Hi Lawrence, we have noticed that one of the functions has a strange name: +pidofprof () { + /etc/redhat-lsb/lsb_pidofproc "$@" Shouldn't that be pidofproc instead? Jan
A package has been built which should help the problem described in this bug report. This report is therefore being closed with a resolution of CURRENTRELEASE. You may reopen this bug report if the solution does not work for you.
Created attachment 151434 [details] lsb-aliases_to_funcs.patch
5.1 should be better. I will try to propose.
Did we integrate this patch?
Not in 5.0 but it will be available in the 5.1 update.
*** Bug 230973 has been marked as a duplicate of this bug. ***
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-0590.html