Bug 478254

Summary: MIGRATED_FROM_JIRA: Init Script handling Dangling PID
Product: [Retired] penrose Reporter: Chandrasekar Kannan <ckannan>
Component: InstallationAssignee: Endi Sukma Dewata <edewata>
Status: CLOSED EOL QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: 2.0CC: benl, nmalki, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:41:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 471500    

Description Chandrasekar Kannan 2008-12-27 08:12:28 UTC
In the script:
/usr/local/penrose-server-pro-2.0b5/bin/penrose-server.sh

There is a section that looks like this:

PENROSE_PID="$PENROSE_HOME/logs/penrose.pid"


if [ "$1" = "start" ] ; then

 if [ -f "$PENROSE_PID" ] ; then
   echo Penrose Server is running
   exit 1


The problem is that if the machine is rebooted, the $PENROSE_PID
file might still exist from the time the machine was last up
and running.  This was preventing the script from starting up
penrose properly (and this in fact is what was happening)
Additional Comments From jimyang dated Thu Mar 20 16:30:18 CDT 2008 
use running() that can be called to validate the pid.

running()
{
    [ -f $1 ] || return 1
    PID=$(cat $1)
    ps -p $PID >/dev/null 2>/dev/null || return 1
    return 0
}

it uses ps to validate the pid

refer to https://svn.codehaus.org/jetty/jetty/trunk/bin/jetty.sh

Additional Comments From jimyang dated Tue Apr 01 15:36:18 CDT 2008 
Using PS() to validate the process name. If PS(dangling_pid) != name of the actual process then we will delete the dangling PID and start the server.


=========================================================
Issue dump from jira
$VAR1 = {
          'priority' => '3',
          'customFieldValues' => [],
          'project' => 'PENROSE',
          'status' => '5',
          'components' => [
                            {
                              'name' => 'Installation',
                              'id' => '10016'
                            }
                          ],
          'reporter' => 'jimyang',
          'key' => 'PENROSE-289',
          'assignee' => 'jimyang',
          'summary' => 'Init Script handling Dangling PID',
          'id' => '10982',
          'updated' => '2008-04-01 15:36:18.0',
          'votes' => '0',
          'fixVersions' => [
                           {
                             'releaseDate' => '2008-04-07 00:00:00.0',
                             'sequence' => '28',
                             'name' => 'Penrose-2.0RC1',
                             'released' => 'true',
                             'id' => '10093',
                             'archived' => 'false'
                           }
                         ],
          'affectsVersions' => [],
          'description' => 'In the script:
/usr/local/penrose-server-pro-2.0b5/bin/penrose-server.sh

There is a section that looks like this:

PENROSE_PID="$PENROSE_HOME/logs/penrose.pid"


if [ "$1" = "start" ] ; then

 if [ -f "$PENROSE_PID" ] ; then
   echo Penrose Server is running
   exit 1


The problem is that if the machine is rebooted, the $PENROSE_PID
file might still exist from the time the machine was last up
and running.  This was preventing the script from starting up
penrose properly (and this in fact is what was happening)',
          'created' => '2008-03-20 16:29:19.0',
          'resolution' => '1',
          'type' => '1'
        };


=========================================================

Comment 1 Chandrasekar Kannan 2008-12-27 08:12:30 UTC
Marking bug as MODIFIED as it was already resolved in Jira - PENROSE-289