Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Same on RHEL3, RHEL4, FC3. I'll open separate issues. #!/bin/bash . /lib/lsb/init-functions log_success_msg "hi matt" log_failure_msg "hi matt" log_warning_msg "hi matt" causes this output: $ ./lsbinitfunctions ./lsbinitfunctions: line 7: log_success_msg: command not found ./lsbinitfunctions: line 8: log_failure_msg: command not found ./lsbinitfunctions: line 9: log_warning_msg: command not found If I change the alias lines in init-functions to full functions, it succeeds: #!/bin/sh # LSB initscript functions, as defined in the LSB Spec 1.1.0 log_success_msg() { /etc/redhat-lsb/lsb_log_message success "$*" } log_failure_msg() { /etc/redhat-lsb/lsb_log_message failure "$*" } log_warning_msg() { /etc/redhat-lsb/lsb_log_message warning "$*" } #!/bin/bash #. /lib/lsb/init-functions . init-functions log_success_msg "hi matt" log_failure_msg "hi matt" log_warning_msg "hi matt" has the expected result: $ ./lsbinitfunctions hi matt [ OK ] hi matt [FAILED] hi matt [WARNING] The result is that including /lib/lsb/init-functions doesn't work. All the alias lines need to be turned into full functions, if the LSB-compliant initscripts are to work.
FC4-test3 CVS as of now still has this problem, so bumping the report up to that so it has a chance of being fixed for FC4.
Shouldn't LSB-compliant initscripts start with "#!/bin/sh"?
two workarounds: If called as #!/bin/sh, aliases are expanded. If shopt -s expand_aliases and #!/bin/bash are used, then it'll expand the aliases also. I'll close this then.