This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 250535 - improve perldap script execution ability on bundled platforms
improve perldap script execution ability on bundled platforms
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Command Line Utilities (Show other bugs)
1.1.0beta
All Linux
high Severity high
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
:
Depends On:
Blocks: 249650 FDS1.2.0
  Show dependency treegraph
 
Reported: 2007-08-01 23:44 EDT by Rich Megginson
Modified: 2015-01-04 18:27 EST (History)
3 users (show)

See Also:
Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-29 19:00:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
diffs for ldapserver (10.84 KB, patch)
2007-08-01 23:44 EDT, Rich Megginson
no flags Details | Diff
diffs for adminserver (13.29 KB, patch)
2007-08-01 23:45 EDT, Rich Megginson
no flags Details | Diff
cvs commit log (Comment #1) (2.45 KB, text/plain)
2007-08-02 10:40 EDT, Rich Megginson
no flags Details
cvs commit log (Comment #2) (2.45 KB, text/plain)
2007-08-02 10:44 EDT, Rich Megginson
no flags Details

  None (edit)
Description Rich Megginson 2007-08-01 23:44:15 EDT
On bundled platforms, you have to jump through hoops to set the correct
environment variables to run perldap scripts.  Especially the setup scripts. 
The user should not have to set PATH, PERL5LIB, and LD_LIBRARY_PATH to run these
scripts.
Comment 1 Rich Megginson 2007-08-01 23:44:16 EDT
Created attachment 160494 [details]
diffs for ldapserver
Comment 2 Rich Megginson 2007-08-01 23:45:05 EDT
Created attachment 160495 [details]
diffs for adminserver
Comment 3 Nathan Kinder 2007-08-02 01:43:34 EDT
Your changes look good.
Comment 4 Rich Megginson 2007-08-02 10:40:33 EDT
Created attachment 160525 [details]
cvs commit log (Comment #1)

Reviewed by: nkinder (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Most platforms will just use perl from PATH.  However, on
Solaris and HP-UX, we have to use special 64 bit versions to execute perldap,
since perldap is 64 bit on those platforms.  Also, if bundling all of the
dependent components into the single package, we need to make sure the perl
library path is set correctly to find perldap.
The last step will be to build our version of perldap on the bundled platforms
to use rpath to point to the correct runtime library location.
Platforms tested: RHEL4, HP-UX 11.23 IPF 64 bit
Flag Day: no
Doc impact: no
Comment 5 Rich Megginson 2007-08-02 10:44:45 EDT
Created attachment 160526 [details]
cvs commit log (Comment #2)
Comment 6 Nathan Kinder 2007-12-21 16:16:58 EST
Verified that scripts that use PerLDAP, such as migrate-ds.pl, are able to find
all of their Perl modules properly on HP-UX.  I also looked at the paths inside
of these scripts to make sure they look correct.

I found that the repl-monitor.pl script still has a problem however.  If I run
it from the command line using it's wrapper, it is unable to find PerLDAP.  It
isn't setting the perl libpath anywhere, so it's not looking in
/opt/dirsrv/lib/perl.  I also see this problem if I invoke repl-monitor-cgi.pl
from the command line.  If I add a "use lib" line as this bug added to the other
perl scripts, everything works fine.
Comment 7 Nathan Kinder 2007-12-21 16:26:18 EST
There is also a problem on Solaris.  We are using perl from the environment in
repl-monitor.pl, but we need to be using perl from RHATperlx
(/opt/perl5x/bin/perl) for PerLDAP to be found.
Comment 8 Nathan Kinder 2007-12-21 16:48:01 EST
If we move repl-monitor.pl to repl-monitor.pl.in in the source tree and make the
following modification, it should solve both issues.

Index: repl-monitor.pl
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/repl-monitor.pl,v
retrieving revision 1.2
diff -u -5 -t -r1.2 repl-monitor.pl
--- repl-monitor.pl     5 Sep 2007 16:35:28 -0000       1.2
+++ repl-monitor.pl     21 Dec 2007 21:44:57 -0000
@@ -1,6 +1,6 @@
-#!/usr/bin/env perl
+#!@perlexec@
 # BEGIN COPYRIGHT BLOCK
 # This Program is free software; you can redistribute it and/or modify it under
 # the terms of the GNU General Public License as published by the Free Software
 # Foundation; version 2 of the License.
 #
@@ -154,10 +154,12 @@
 # installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
 # this script is always invoked by repl-monitor-cgi.pl, which sets all of these
 # If using this script standalone, be sure to set the shared lib path and
 # the path to the perldap modules.

+use lib qw(@perlpath@);
+
 $usage = "\nusage: $0 -f configuration-file [-h host] [-p port] [-r] [-u
refresh-url] [-t refresh-interval]\n\nor   : $0 -v\n";

 use Getopt::Std;                # parse command line arguments
 use Mozilla::LDAP::Conn;        # LDAP module for Perl
 use Mozilla::LDAP::Utils qw(normalizeDN);       # LULU, utilities.
Comment 9 Rich Megginson 2007-12-21 16:58:59 EST
(In reply to comment #8)

Looks good.
Comment 12 Nathan Kinder 2008-12-12 15:12:31 EST
(In reply to comment #9)
> 
> Looks good.

I'd like to get another ack since it's been a year since you last approved this...
Comment 13 Rich Megginson 2008-12-12 15:31:32 EST
re-ack
Comment 14 Nathan Kinder 2008-12-12 15:36:32 EST
Checked into ldapserver (HEAD).  Thanks to Rich for his review(s)!

Removing repl-monitor.pl;
/cvs/dirsec/ldapserver/ldap/admin/src/scripts/repl-monitor.pl,v  <--  repl-monitor.pl
new revision: delete; previous revision: 1.2
done
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/repl-monitor.pl.in,v
done
Checking in repl-monitor.pl.in;
/cvs/dirsec/ldapserver/ldap/admin/src/scripts/repl-monitor.pl.in,v  <--  repl-monitor.pl.in
initial revision: 1.1
done
Comment 15 Jenny Galipeau 2009-03-30 15:41:40 EDT
Is this something QE can verify?  If so, please add steps to verify.
Comment 16 Rich Megginson 2009-03-30 15:55:19 EDT
The fix is that you can run setup-ds-admin.pl and the other perl scripts without having to first set PATH or LD_LIBRARY_PATH or PERL5LIB to point to the right perl, libs, and perl modules directories.  And this should work on linux, solaris, and hp-ux.
Comment 17 Jenny Galipeau 2009-04-09 15:51:22 EDT
fix verified DS 8.1, no need to set PATH before executing setup-ds-admin.pl, also tested db2ldif, fixup-memberof
Comment 18 Chandrasekar Kannan 2009-04-29 19:00:51 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0455.html

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