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

[LDM #FST-256974]: updating to latest ldm version causes hanging



You appear to be downloading, building, and installing the LDM as root.

That's not what we do or recommend. I hope it doesn't cause problems.

> I adjusted the code so the actions run by root and the actions run by ldm
> user are separated, here it is just for completeness/reference
> 
> #LDM Variables
> $LDM_HOME='/home/ldm'
> $LDM_SCRIPT='/home/ldm/install_ldm.sh'
> $LDM_FTP='ftp://ftp.unidata.ucar.edu/pub/ldm'
> $LDM_VERSION=(Invoke-WebRequest -Uri "$LDM_FTP/versions" -UseBasicParsing
> -Verbose:$false).RawContent.Split()[2].Replace('.tar.gz','')
> $LDM_ZIP="ldm-$LDM_VERSION.tar.gz"
> $LDM_LOG='/tmp/ldm_install.log'
> Write-Verbose "LDM Version is $LDM_VERSION"
> 
> #Create LDM Home Directory
> nxFile ldmhome {
> Ensure = 'Present'
> DestinationPath = $LDM_HOME
> Type = 'directory'
> Owner = 'ldm'
> Group = 'domain users'
> Mode = '700'
> }
> 
> #Script which contains the part of the LDM install to be run as the ldm user
> $ldminstallscriptcontents=@"
> #!/bin/bash
> 
> #remove link to previous version
> if [ -L $LDM_HOME/runtime ]
> then
> rm -f $LDM_HOME/runtime
> fi
> 
> #download
> wget --directory-prefix $LDM_HOME $LDM_FTP/$LDM_ZIP > $LDM_LOG 2>&1
> 
> #unzip
> cd $LDM_HOME
> gunzip -c $LDM_ZIP | pax -r '-s:/:/src/:'
> rm $LDM_ZIP
> 
> #configure and build
> cd $LDM_HOME/ldm-$LDM_VERSION/src/
> ./configure --disable-root-actions >> $LDM_LOG 2>&1
> make install >> $LDM_LOG 2>&1
> "@
> nxFile ldminstallscript {
> Ensure = 'Present'
> DestinationPath=$LDM_SCRIPT
> Contents=LinuxString($ldminstallscriptcontents)
> Type='file'
> Owner='ldm'
> Group='domain users'
> Mode='700'
> }
> 
> #Install LDM
> nxScript ldmApplication {
> GetScript = @"
> #do nothing
> "@
> SetScript = @"
> #!/bin/bash
> 
> #stop ldm if it is running
> if [ -f $LDM_HOME/ldmd.pid ]
> then
> systemctl stop ldm
> fi
> 
> #run the install script which contains the actions to be run as the ldm user
> sudo -u ldm $LDM_SCRIPT
> 
> #run make root-actions command which sets some of the ldm binaries back to
> root
> cd $LDM_HOME/ldm-$LDM_VERSION/src/
> make root-actions >> $LDM_LOG 2>&1
> "@
> TestScript = @"
> #!/bin/bash
> if [ -f $LDM_HOME/ldm-$LDM_VERSION/bin/ldmadmin ]
> then
> exit 0
> else
> exit 1
> fi
> "@
> DependsOn = '[nxFile]ldmhome',
> '[nxFile]ldminstallscript',
> '[nxPackage]wget',
> '[nxPackage]pax',
> '[nxPackage]gcc',
> '[nxPackage]libxml2_devel',
> '[nxPackage]libstdc_static',
> '[nxPackage]zlib_devel',
> '[nxPackage]make',
> '[nxPackage]bc',
> '[nxPackage]perl'
> }
> 
> 
> 
> and here are the resultant permissions:
> 
> [ldm@NOAA8203-LDM2 bin]$ ls -l
> total 1528
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 afos -> pqing
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 ddplus -> pqing
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 dds -> pqing
> -rwxr-xr-x. 1 ldm  domain users    619 Aug 15 16:59 ensureLdmhomeLinks
> -rwxr-xr-x. 1 ldm  domain users    156 Aug 15 16:59 ensureRpcEntry
> -rwxr-xr-x. 1 ldm  domain users    173 Aug 15 16:59 ensureServicesEntry
> -rwxr-xr-x. 1 ldm  domain users   1700 Aug 15 16:59 ensureSyslogEntry
> -rwxr-xr-x. 1 ldm  domain users    612 Aug 15 16:59 ensureVar
> -rwxr-xr-x. 1 ldm  domain users  44896 Aug 15 16:59 feedme
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 feedtest -> pqing
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 hds -> pqing
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 hrs -> pqing
> -rwsr-xr--. 1 root domain users  12728 Aug 15 16:59 hupsyslog
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 ids -> pqing
> -rwxr-xr-x. 1 ldm  domain users  60750 Aug 15 16:59 ldmadmin
> -rwsr-xr--. 1 root domain users  68880 Aug 15 16:59 ldmd
> -rwxr-xr-x. 1 ldm  domain users   7331 Aug 15 16:59 ldmfail
> -rwxr-xr-x. 1 ldm  domain users  33888 Aug 15 16:59 ldmping
> -rwxr-xr-x. 1 ldm  domain users  38344 Aug 15 16:59 ldmsend
> -rwxr-xr-x. 1 ldm  domain users   8993 Aug 15 16:59 netcheck
> -rwxr-xr-x. 1 ldm  domain users    910 Aug 15 16:59 newlog
> -rwxr-xr-x. 1 ldm  domain users  36720 Aug 15 16:59 notifyme
> -rwxr-xr-x. 1 ldm  domain users   6644 Aug 15 16:59 plotMetrics
> lrwxrwxrwx. 1 ldm  domain users      5 Aug 15 16:59 pps -> pqing
> -rwxr-xr-x. 1 ldm  domain users  47592 Aug 15 16:59 pq_test_insert
> -rwxr-xr-x. 1 ldm  domain users 228448 Aug 15 16:59 pqact
> -rwxr-xr-x. 1 ldm  domain users  42992 Aug 15 16:59 pqcat
> -rwxr-xr-x. 1 ldm  domain users  23904 Aug 15 16:59 pqcheck
> -rwxr-xr-x. 1 ldm  domain users  34952 Aug 15 16:59 pqcopy
> -rwxr-xr-x. 1 ldm  domain users  21624 Aug 15 16:59 pqcreate
> -rwxr-xr-x. 1 ldm  domain users  42416 Aug 15 16:59 pqexpire
> -rwxr-xr-x. 1 ldm  domain users 167288 Aug 15 16:59 pqing
> -rwxr-xr-x. 1 ldm  domain users  38328 Aug 15 16:59 pqinsert
> -rwxr-xr-x. 1 ldm  domain users  35416 Aug 15 16:59 pqmon
> -rwxr-xr-x. 1 ldm  domain users  53872 Aug 15 16:59 pqsend
> -rwxr-xr-x. 1 ldm  domain users  83648 Aug 15 16:59 pqsurf
> -rwxr-xr-x. 1 ldm  domain users 110224 Aug 15 16:59 pqutil
> -rwxr-xr-x. 1 ldm  domain users    535 Aug 15 16:59 refresh_logging
> -rwxr-xr-x. 1 ldm  domain users  14912 Aug 15 16:59 regex
> -rwxr-xr-x. 1 ldm  domain users  43728 Aug 15 16:59 regutil
> -rwxr-xr-x. 1 ldm  domain users   1958 Aug 15 16:59 rpmUserActions
> -rwxr-xr-x. 1 ldm  domain users  99088 Aug 15 16:59 rtstats
> -rwxr-xr-x. 1 ldm  domain users   4283 Aug 15 16:59 scour
> -rwxr-xr-x. 1 ldm  domain users   7380 Aug 15 16:59 syscheck
> -rwxr-xr-x. 1 ldm  domain users  24688 Aug 15 16:59 uldbutil
> -rwxr-xr-x. 1 ldm  domain users  24000 Aug 15 16:59 ulogger
> -rwxr-xr-x. 1 ldm  domain users    246 Aug 15 16:59 updateGempakTables
> -rwxr-xr-x. 1 ldm  domain users   1029 Aug 15 16:59 wasReceived

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: FST-256974
Department: Support LDM
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.