[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 19990727: ldmadmin isrunning



Jim,

Another solution would be to add the command ldmadmin clean to the start
up script, that clears out the lock file and the ldmd.pid file.  I decided
to go with your solution because it doesn't cause any changes to the LDM
preinstall configurations. 


I talked to Russ about  syncing netCDF file cost.  He seems to think that
the current mechanism is adequate for almost all our users, so I not going
to change it. One is always welcome to make mods for their own site needs
and make changes as you have already done.

Thanks for the bug reports, many users never give any feedback on
problems.  Makes it hard to get out all the bugs.

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/
===============================================================================