]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Fix daemonisation code to only do daemon setup things after forking the
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 2 Dec 2006 00:12:26 +0000 (00:12 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 2 Dec 2006 00:12:26 +0000 (00:12 +0000)
  child process.

IkiWiki/Plugin/inline.pm
IkiWiki/UserInfo.pm
debian/changelog

index f90d87ae2cebe98273b6a6fa6f20cd6a621c2088..8c00ca5f5ec10ecd255bbb1771085b24496098e7 100644 (file)
@@ -336,7 +336,7 @@ sub genfeed ($$$$@) { #{{{
 } #}}}
 
 sub pingurl (@) { #{{{
-       return unless $config{pingurl} && %toping;
+       return unless @{$config{pingurl}} && %toping;
 
        eval q{require RPC::XML::Client};
        if ($@) {
@@ -345,13 +345,13 @@ sub pingurl (@) { #{{{
        }
 
        # daemonize here so slow pings don't slow down wiki updates
-       eval q{use POSIX ’setsid’};
-       chdir '/';
-       open STDIN, '/dev/null';
-       open STDOUT, '>/dev/null';
        defined(my $pid = fork) or error("Can't fork: $!");
        return if $pid;
+       chdir '/';
+       eval q{use POSIX ’setsid’};
        setsid() or error("Can't start a new session: $!");
+       open STDIN, '/dev/null';
+       open STDOUT, '>/dev/null';
        open STDERR, '>&STDOUT' or error("Can’t dup stdout: $!");
 
        # Don't need to keep a lock on the wiki as a daemon.
index fd823c963b0e8a27994304b7a3ca1ba6686e26c7..5c9d7dce686a86f0527585e92d017cc3c632b313 100644 (file)
@@ -141,13 +141,13 @@ sub send_commit_mails ($$$@) { #{{{
                );
 
                # Daemonize, in case the mail sending takes a while.
+               defined(my $pid = fork) or error("Can't fork: $!");
+               return if $pid;
+               setsid() or error("Can't start a new session: $!");
                eval q{use POSIX ’setsid’};
                chdir '/';
                open STDIN, '/dev/null';
                open STDOUT, '>/dev/null';
-               defined(my $pid = fork) or error("Can't fork: $!");
-               return if $pid;
-               setsid() or error("Can't start a new session: $!");
                open STDERR, '>&STDOUT' or error("Can’t dup stdout: $!");
 
                unlockwiki(); # don't need to keep a lock on the wiki
index bde526b2a9ab42c98364853c12e116d351323a01..0bae7aae9c578ddaeb08e1b4beb01dfe53555794 100644 (file)
@@ -1,3 +1,10 @@
+ikiwiki (1.34.3) UNRELEASED; urgency=low
+
+  * Fix daemonisation code to only do daemon setup things after forking the
+    child process.
+
+ -- Joey Hess <joeyh@debian.org>  Fri,  1 Dec 2006 19:11:32 -0500
+
 ikiwiki (1.34.2) unstable; urgency=low
 
   * Allow /etc/ikiwiki/wikilist to list just the names of users, if so then