Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 51822 invoked from network); 29 Aug 2007 12:24:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Aug 2007 12:24:35 -0000 Received: (qmail 40640 invoked by uid 500); 29 Aug 2007 12:24:25 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 40627 invoked by uid 500); 29 Aug 2007 12:24:25 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 40616 invoked by uid 99); 29 Aug 2007 12:24:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 05:24:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [217.199.181.14] (HELO faraday.net.versatilia.com) (217.199.181.14) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 12:25:17 +0000 Received: from [84.12.213.145] (helo=[172.26.105.48]) by faraday.net.versatilia.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.43) id 1IQMjV-0004nh-1u; Wed, 29 Aug 2007 13:33:17 +0100 Message-ID: <46D56542.50109@o-rourke.org> Date: Wed, 29 Aug 2007 13:23:30 +0100 From: John ORourke User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Matthieu FEREYRE CC: Stephane GUIBOUD-RIBAUD , modperl@perl.apache.org Subject: Re: Restarting Apache2.2 from PERL References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Versatilia-MailScanner-Information: See http://www.versatilia.com/mailscanning.html X-Versatilia-MailScanner: Found to be virus free Envelope-From: john-modperl@o-rourke.org X-Virus-Checked: Checked by ClamAV on apache.org Matthieu FEREYRE wrote: > > kill -USR1 apache_pid > > do that extremly well but apache doesn't have the rights to launch it > from perl ! > Try writing a script which does it - eg. #!/bin/sh /etc/init.d/apache restart put that somewhere and make it setuid root, then in your perl code call system("/path/to/your/script &"); which would launch it in the background and return control sensibly, I think. The 2 flaws are [1] you have no way to feed back success to the user - you could put a Refresh header in the returned page to jump to a status page - and [2] any script or user on your server would be able to restart it by running the setuid root script. cheers John