]> git.ipfire.org Git - thirdparty/bugzilla.git/blob - jobqueue.pl
add a new hook: template_after_create (#60)
[thirdparty/bugzilla.git] / jobqueue.pl
1 #!/usr/bin/perl
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 #
6 # This Source Code Form is "Incompatible With Secondary Licenses", as
7 # defined by the Mozilla Public License, v. 2.0.
8
9 use 5.10.1;
10 use strict;
11 use warnings;
12
13 use Cwd qw(abs_path);
14 use File::Basename;
15 BEGIN {
16 # Untaint the abs_path.
17 my ($a) = abs_path($0) =~ /^(.*)$/;
18 chdir dirname($a);
19 }
20
21 use lib qw(. lib);
22 use Bugzilla;
23 use Bugzilla::JobQueue::Runner;
24
25 Bugzilla::JobQueue::Runner->new();
26
27 =head1 NAME
28
29 jobqueue.pl - Runs jobs in the background for Bugzilla.
30
31 =head1 SYNOPSIS
32
33 ./jobqueue.pl [OPTIONS] COMMAND
34
35 OPTIONS:
36 -f Run in the foreground (don't detach)
37 -d Output a lot of debugging information
38 -p file Specify the file where jobqueue.pl should store its current
39 process id. Defaults to F<data/jobqueue.pl.pid>.
40 -n name What should this process call itself in the system log?
41 Defaults to the full path you used to invoke the script.
42
43 COMMANDS:
44 start Starts a new jobqueue daemon if there isn't one running already
45 stop Stops a running jobqueue daemon
46 restart Stops a running jobqueue if one is running, and then
47 starts a new one.
48 once Checks the job queue once, executes the first item found (if
49 any, up to a limit of 1000 items) and then exits
50 onepass Checks the job queue, executes all items found, and then exits
51 check Report the current status of the daemon.
52 install On some *nix systems, this automatically installs and
53 configures jobqueue.pl as a system service so that it will
54 start every time the machine boots.
55 uninstall Removes the system service for jobqueue.pl.
56 help Display this usage info
57 version Display the version of jobqueue.pl
58
59 =head1 DESCRIPTION
60
61 See L<Bugzilla::JobQueue> and L<Bugzilla::JobQueue::Runner>.
62
63 =head1 Running jobqueue.pl as a System Service
64
65 For systems that use Upstart or SysV Init, there is a SysV/Upstart init
66 script included with Bugzilla for jobqueue.pl: F<contrib/bugzilla-queue>.
67 It should work out-of-the-box on RHEL, Fedora, CentOS etc.
68
69 You can install it by doing C<./jobqueue.pl install> as root, after
70 already having run L<checksetup> at least once to completion
71 on this Bugzilla installation.
72
73 If you are using a system that isn't RHEL, Fedora, CentOS, etc., then you
74 may have to modify F<contrib/bugzilla-queue> and install it yourself
75 manually in order to get C<jobqueue.pl> running as a system service.