Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 56604
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.97
Fixed in: (no value)



Subject: [PATCH] check_pid_file() invokes ps incorrectly
In Net::Server::Daemonize's check_pid_file() function, it invokes ps thusly: $exists = `ps h o pid p $current_pid`; I suspect this is to generate a one line output of the pid if it's running. The comment above it notes "this will fail on Unix98 syntax ps (Solaris, etc)"; Mac OS X can be added to the list. For SUSv3-compliant implementations, the following invocation delivers the same output: ps -o pid -p 1 | tail +2
This has been fixed in 0.99. It now attempts to use kill 0 before ps.
Subject: Re: [rt.cpan.org #56604] [PATCH] check_pid_file() invokes ps incorrectly
Date: Tue, 13 Jul 2010 14:21:35 -0600
To: bug-Net-Server [...] rt.cpan.org
From: Paul Seamons <paul [...] seamons.com>
On 04/14/2010 04:26 PM, http://keeperofthecheese.myopenid.com/ via RT wrote: Show quoted text
> Wed Apr 14 18:26:07 2010: Request 56604 was acted upon. > Transaction: Ticket created by http://keeperofthecheese.myopenid.com/ > Queue: Net-Server > Subject: [PATCH] check_pid_file() invokes ps incorrectly > Broken in: 0.97 > Severity: Important > Owner: Nobody > Requestors: > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=56604> > > > In Net::Server::Daemonize's check_pid_file() function, it invokes ps thusly: > $exists = `ps h o pid p $current_pid`; > I suspect this is to generate a one line output of the pid if it's running. The comment above it > notes "this will fail on Unix98 syntax ps (Solaris, etc)"; Mac OS X can be added to the list. > > For SUSv3-compliant implementations, the following invocation delivers the same output: > ps -o pid -p 1 | tail +2 > >
This should be fixed in 0.99. Thank you.
The code no longer does any ps execution. It now tries the /proc system first (if it exists) and then uses kill 0. The code is updated as of the just released version 2.000