Created attachment 947404 [details] log from jabberd service starting with "set -x" inserted Description of problem: When starting jabberd service, you get the following error messages: Initializing jabberd processes ... Starting router: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Starting sm: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Starting c2s: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Starting s2s: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Version-Release number of selected component (if applicable): jabberd-2.2.8-22.el6sat.x86_64 How reproducible: Always. Steps to Reproduce: 1. Stop and restart jabberd service: rhn-setellite restart (*) 2. 3. * I guess I could just stop and start, or restart jabberd service alone, but I'm not sure if restarting it alone might disrupt other services. Better safer than sorry. Actual results: Initializing jabberd processes ... Starting router: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Starting sm: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Starting c2s: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Starting s2s: /usr/bin/dirname: extra operand `2>&1' Try `/usr/bin/dirname --help' for more information. [ OK ] Expected results: Initializing jabberd processes ... Starting router: [ OK ] Starting sm: [ OK ] Starting c2s: [ OK ] Starting s2s: [ OK ] Additional info: I took a look at /etc/rc.d/init.d/jabberd and /etc/rc.d/init.d/function. I conclude that the above errors are generated within __pids_var_run() function (defined in function). Because jabberd script calls the daemon() with a shell command line "${progsPath}/${prog} ${args} >/dev/null 2>&1 &" instead of a path to the program file, daemon() incorrectly extracts the string "null 2>&1 &" as the basename of the program path. Then daemon() passes the string to __pids_var_run() where it tries to get the directory part of the supposedly path string with the following command: dirname null 2>&1 &.pid ~~~~~~~~~~~~~~~ Because the underlined part is passed as a single string(?), it does not seem to be evaluated by the shell and passed through to dirname which in turn throws the error. I attached a log that I created by inserting "set -x" at the beginning of /etc/init.d/jabberd so you can see the above sequence of execution. I'm not entirely sure which to blame; the daemon() in function or jabberd init script's invocation of daemon(), but since daemon()'s usage says "Usage: daemon [+/-nicelevel] {program}", I'm inclined to blame this behavior on jabberd init script. Note: these errors do not appear to inhibit jabberd services from properly functioning (jabberd services do not use /var/run/*.pid files), so I say this is very low impact and just cosmetic only (hence "low" severity).
The cause of this problem is a bug 1153677, please mark them as duplicates.
*** This bug has been marked as a duplicate of bug 1153677 ***