Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
9ced0509
Commit
9ced0509
authored
Aug 18, 2009
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 509539: Allow jobqueue.pl to specify where it stores its PID
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
parent
5f725ca6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
10 deletions
+55
-10
Runner.pm
Bugzilla/JobQueue/Runner.pm
+47
-9
jobqueue.pl
jobqueue.pl
+8
-1
No files found.
Bugzilla/JobQueue/Runner.pm
View file @
9ced0509
...
...
@@ -35,18 +35,56 @@ use Bugzilla::JobQueue;
use
Bugzilla::
Util
qw(get_text)
;
BEGIN
{
eval
"use base qw(Daemon::Generic)"
;
}
# Required because of a bug in Daemon::Generic where it won't use the
# "version" key from DAEMON_CONFIG.
our
$VERSION
=
BUGZILLA_VERSION
;
use
constant
DAEMON_CONFIG
=>
(
progname
=>
basename
(
$0
),
pidfile
=>
bz_locations
()
->
{
datadir
}
.
'/'
.
basename
(
$0
)
.
'.pid'
,
version
=>
BUGZILLA_VERSION
,
);
# The Daemon::Generic docs say that it uses all sorts of
# things from gd_preconfig, but in fact it does not. The
# only thing it uses from gd_preconfig is the "pidfile"
# config parameter.
sub
gd_preconfig
{
return
DAEMON_CONFIG
;
my
$self
=
shift
;
my
$pidfile
=
$self
->
{
gd_args
}{
pidfile
};
if
(
!
$pidfile
)
{
$pidfile
=
bz_locations
()
->
{
datadir
}
.
'/'
.
$self
->
{
gd_progname
}
.
".pid"
;
}
return
(
pidfile
=>
$pidfile
);
}
# All config other than the pidfile has to be done in gd_getopt
# in order for it to be set up early enough.
sub
gd_getopt
{
my
$self
=
shift
;
$self
->
SUPER::
gd_getopt
();
if
(
$self
->
{
gd_args
}{
progname
})
{
$self
->
{
gd_progname
}
=
$self
->
{
gd_args
}{
progname
};
}
else
{
$self
->
{
gd_progname
}
=
basename
(
$0
);
}
# There are places that Daemon Generic's new() uses $0 instead of
# gd_progname, which it really shouldn't, but this hack fixes it.
$self
->
{
_original_zero
}
=
$0
;
$0
=
$self
->
{
gd_progname
};
}
sub
gd_postconfig
{
my
$self
=
shift
;
# See the hack above in gd_getopt. This just reverses it
# in case anything else needs the accurate $0.
$0
=
delete
$self
->
{
_original_zero
};
}
sub
gd_more_opt
{
my
$self
=
shift
;
return
(
'pidfile=s'
=>
\
$self
->
{
gd_args
}{
pidfile
},
'n=s'
=>
\
$self
->
{
gd_args
}{
progname
},
);
}
sub
gd_usage
{
...
...
jobqueue.pl
100644 → 100755
View file @
9ced0509
...
...
@@ -37,10 +37,17 @@ jobqueue.pl - Runs jobs in the background for Bugzilla.
=
head1
SYNOPSIS
./
jobqueue
.
pl
[
-
f
]
[
-
d
]
{
start
|
stop
|
restart
|
check
|
help
|
version
}
./
jobqueue
.
pl
[
OPTION
]
{
start
|
stop
|
restart
|
check
|
help
|
version
}
OPTIONS:
-
f
Run
in
the
foreground
(
don
't detach)
-d Output a lot of debugging information
-p file Specify the file where jobqueue.pl should store its current
process id. Defaults to F<data/jobqueue.pl.pid>.
-n name What should this process call itself in the system log?
Defaults to the full path you used to invoke the script.
COMMANDS:
start Starts a new jobqueue daemon if there isn'
t
one
running
already
stop
Stops
a
running
jobqueue
daemon
restart
Stops
a
running
jobqueue
if
one
is
running
,
and
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment