root/trunk/mt-testbg.cgi

Revision 4196, 0.8 kB (checked in by takayama, 3 months ago)

* Set svn keywords

  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/perl -w
2
3# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd.
4# This program is distributed under the terms of the
5# GNU General Public License, version 2.
6#
7# $Id$
8
9use strict;
10
11local $| = 1;
12print "Content-Type: text/html\n\n";
13print "<html>\n<body>\n<pre>\n\n";
14
15eval {
16    local $SIG{__WARN__} = sub { print "**** WARNING: $_[0]\n" };
17
18    my $pid = fork(); 
19    if (defined $pid)
20    {
21        if ($pid) {
22            print wait() > 0
23                   ? "Background tasks are available\n" 
24                   : "Background tasks are not available\n";
25        } else { 
26            sleep 1;
27            exit(0);
28        } 
29    } else { print "Background tasks are not available\n"; }
30};
31print "Got an error: $@" if $@;
32
33print "\n\n</pre>\n</body>\n</html>";
34
Note: See TracBrowser for help on using the browser.