[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 19990727: ldmadmin isrunning
- Subject: Re: 19990727: ldmadmin isrunning
- Date: Wed, 28 Jul 1999 10:06:39 -0600 (MDT)
Jim,
Thanks for finding that bug, I'll make it more robust.
Robb...
On Tue, 27 Jul 1999, Unidata Support wrote:
>
> ------- Forwarded Message
>
> >To: address@hidden
> >cc: John Murphy <address@hidden>
> >From: Jim Cowie <address@hidden>
> >Subject: ldmadmin isrunning
> >Organization: .
> >Keywords: 199907271507.JAA28346
>
>
> Found an obscure bug in ldmadmin. (5.0.6 and greater) The command
> 'ldmadmin isrunning' can return 0 (indicating that it is running)
> when it is actually not running and an old ldmd.pid file exists with
> a process ID that matches a non-ldm process. Here is the scenario
> where I've seen this happen several times.
>
> LDM starts soon after a reboot and thus gets a fairly low (ie; small)
> process ID. Sometime later the system crashes or reboots suddenly.
> The ldmd.pid file still exists. The command 'ldmadmin isrunning'
> is executed, it gets the process ID from the ldmd.pid file, then
> checks that that process is running. But that process is not an LDM
> process, it's something totally unrelated that was started upon boot
> up depending on the vaguaries of the system. ldmadmin isrunning then
> returns saying the LDM is running when it's not.
>
> For the time being, I modified our version of the check_running()
> subroutine to change the command that looks for the process from the
> ldmd.pid file. I changed it to grep for the string "rpc.ldmd" to confirm
> that it's actually an LDM that that process ID belongs to.
>
> -jim
>
>
>
> sub check_running {
>
> my($pid_num, $ps_cmd);
>
> $pid_num = getPid() ;
>
> return 1 if( $pid_num == -1 ) ;
>
> if (($os eq "SunOS" && $version =~ /^4/) || $os eq "Linux" ) {
> $ps_cmd = "ps $pid_num | grep rpc.ldmd | grep -v grep";
>
> } else {
> $ps_cmd = "ps -p $pid_num | grep rpc.ldmd | grep -v grep";
> }
>
> `$ps_cmd`;
>
> if ($?) {
> return 1;
> }
> else {
> return 0;
> }
> }
>
>
> --
> Jim Cowie Software Engineer
> WITI Corporation address@hidden
> 3300 Mitchell Lane
> Boulder, CO 80301 (303) 497-8584
>
>
> ------- End of Forwarded Message
>
===============================================================================
Robb Kambic Unidata Program Center
Software Engineer III Univ. Corp for Atmospheric Research
address@hidden WWW: http://www.unidata.ucar.edu/
===============================================================================