Bug 1153457 - When starting jabberd service, dirname prints out error messages
Summary: When starting jabberd service, dirname prints out error messages
Keywords:
Status: CLOSED DUPLICATE of bug 1153677
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 560
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-16 04:13 UTC by Ken Sugawara
Modified: 2019-02-15 13:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-06 10:26:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log from jabberd service starting with "set -x" inserted (9.34 KB, text/plain)
2014-10-16 04:13 UTC, Ken Sugawara
no flags Details

Description Ken Sugawara 2014-10-16 04:13:55 UTC
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).

Comment 1 Fabiano Martins 2014-10-31 17:44:18 UTC
The cause of this problem is a bug 1153677, please mark them as duplicates.

Comment 2 Clifford Perry 2014-11-06 10:26:21 UTC

*** This bug has been marked as a duplicate of bug 1153677 ***


Note You need to log in before you can comment on or make changes to this bug.