Bug 478254 - MIGRATED_FROM_JIRA: Init Script handling Dangling PID
Summary: MIGRATED_FROM_JIRA: Init Script handling Dangling PID
Keywords:
Status: CLOSED EOL
Alias: None
Product: penrose
Classification: Retired
Component: Installation
Version: 2.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Endi Sukma Dewata
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: 471500
TreeView+ depends on / blocked
 
Reported: 2008-12-27 08:12 UTC by Chandrasekar Kannan
Modified: 2020-03-27 19:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:41:31 UTC
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.