Closed
Bug 556195
Opened 15 years ago
Closed 12 years ago
bugzilla-queue initscript returns wrong result code when the daemon isn't running.
Categories
(Bugzilla :: Installation & Upgrading, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: justdave, Assigned: mkanat)
Details
Attachments
(1 file)
923 bytes,
patch
|
justdave
:
review+
|
Details | Diff | Splinter Review |
We use the puppet configuration system on our servers. Puppet automatically checks in every 30 minutes an updates configuration on the server to match the rules we've defined for it in case we've updated any config.
I thought I was being smart and told puppet to start bugzilla-queue if it checked in and bugzilla-queue wasn't running. To my surprise, it claimed it was having to start it on every pass. I didn't think it likely that it really would have died that frequently, so investigating, I discovered that the status function on the initscript is returning an OK result code whether the daemon is running or not.
Examples:
[root@pm-app-bugs05 ~]# service bugzilla-queue status; echo $?
Configuration looks okay
No bugzilla-queue running
0 jobs in the queue.
0
[root@pm-app-bugs05 ~]# service cups status; echo $?
cupsd is stopped
3
As you can see, the cups initscript returns a result code of 3 when it's not running, where bugzilla-queue returns 0. I'm not sure if the actual code is important, I think the important thing is that it's non-zero.
Reporter | ||
Comment 1•15 years ago
|
||
er, let me redescribe that, the above isn't quite accurate (the problem is, the symptoms I reported are not). By default, puppet looks for a process with the name of the service in the process list. This is why it always thought it wasn't running, because there was no process named "bugzilla-queue" (the process is named "jobqueue.pl"). Puppet does this by default because a lot of initscripts don't have a functional "status" command. However, there is a flag you can set to tell it that the status script works, and then it'll use it. So I turned on this flag to tell it to use the status script. Now it always thinks it's running, and fails to start it if it's not running.
Assignee | ||
Comment 2•15 years ago
|
||
Oh, though it does still return bad result codes in several places, which it shouldn't do.
Assignee | ||
Updated•15 years ago
|
Severity: normal → minor
Target Milestone: --- → Bugzilla 3.6
Assignee | ||
Comment 3•15 years ago
|
||
This handles the queue return values for everything that we can control. The return value of "check" is unfortunately controlled by Daemon::Generic, and is always 0.
Reporter | ||
Comment 4•15 years ago
|
||
hmm, these changes are nice, but it doesn't seem to solve the original problem.
Poking around at the source code, it looks like Daemon::Generic has a "status" command, which does indeed return a result code of 3 if it's not running. If I change the "check" to "status" in the command issued from the bugzilla-queue initscript, then it works. The output you get when it's not running is less than useful though.
[root@dm-bugstage03 ~]# service bugzilla-queue status; echo $?
Unused
3
[root@dm-bugstage03 ~]# service bugzilla-queue start
Starting bugzilla-queue: [ OK ]
[root@dm-bugstage03 ~]# service bugzilla-queue status; echo $?
bugzilla-queue running - pid 11763
0 jobs in the queue.
0
Maybe bugzilla-queue should have separate status and check actions as well.
Assignee | ||
Comment 5•15 years ago
|
||
What version of Daemon::Generic are you using? In 0.61, the "check" command looks to return the right return code.
Reporter | ||
Comment 6•15 years ago
|
||
[~]# rpm -q perl-Daemon-Generic
perl-Daemon-Generic-0.61-1.el5.rf
[~]# service bugzilla-queue status; echo $?
Configuration looks okay
bugzilla-queue running - pid 11763
0 jobs in the queue.
0
[~]# service bugzilla-queue stop
Killing bugzilla-queue: [ OK ]
[~]# service bugzilla-queue status; echo $?
Configuration looks okay
No bugzilla-queue running
0 jobs in the queue.
0
It does return the correct return code if I send it a "status" command rather than "check"
Comment 7•15 years ago
|
||
What do you think of lsb-izing the bugzilla-queue script?
Assignee | ||
Comment 8•15 years ago
|
||
(In reply to comment #7)
> What do you think of lsb-izing the bugzilla-queue script?
Well, this particular bug isn't really about the bugzilla-queue script--it has to do with Daemon::Generic. But if there are aspects of the script that aren't LSB, and you can make it LSB and still have it work on RHEL5, then you're welcome to do that in another bug.
Comment 9•15 years ago
|
||
Well, I have a lsb-ized version that does the right thing (and thus would
seem to resolve this bug), even without Daemon::Generic installed. But,
I don't have a RHEL5 system to test it on.
Assignee | ||
Comment 10•15 years ago
|
||
Okay. Well, I have many RHEL systems to test on, so file a different bug and attach the patch there.
Comment 11•15 years ago
|
||
Bug 563641 opened; patch attached there.
Updated•14 years ago
|
Target Milestone: Bugzilla 3.6 → Bugzilla 4.0
Updated•13 years ago
|
Target Milestone: Bugzilla 4.0 → Bugzilla 4.2
Reporter | ||
Comment 12•12 years ago
|
||
Comment on attachment 436128 [details] [diff] [review]
v1
Review of attachment 436128 [details] [diff] [review]:
-----------------------------------------------------------------
This fixes the correct results codes, so this should do.
Attachment #436128 -
Flags: review?(justdave) → review+
Updated•12 years ago
|
Flags: approval4.4+
Flags: approval+
OS: Linux → All
Hardware: x86 → All
Target Milestone: Bugzilla 4.2 → Bugzilla 4.4
Comment 13•12 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified contrib/bugzilla-queue.rhel
Committed revision 8473.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified contrib/bugzilla-queue.rhel
Committed revision 8460.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 14•12 years ago
|
||
Added to relnotes for 4.4rc2.
You need to log in
before you can comment on or make changes to this bug.
Description
•