summaryrefslogtreecommitdiffstats
path: root/ldap/admin/src/scripts
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-10-21 19:21:19 +0000
committerRich Megginson <rmeggins@redhat.com>2005-10-21 19:21:19 +0000
commit35f8ea348b5f4c08f8e09130db59abddd849d870 (patch)
tree4089978c5ec8c123e0c4c81bc8b7f06683bca8a7 /ldap/admin/src/scripts
parent8216af284bf01728074d474131ae781e6033055c (diff)
downloadds-35f8ea348b5f4c08f8e09130db59abddd849d870.tar.gz
ds-35f8ea348b5f4c08f8e09130db59abddd849d870.tar.xz
ds-35f8ea348b5f4c08f8e09130db59abddd849d870.zip
Bug(s) fixed: 171066
Bug Description: Get rid of nsperl; use perldap with system perl Reviewed by: Noriko, Rob, Nathan (Thanks!) Branch: HEAD Fix Description: All perl scripts are made executable by using the #!/usr/bin/env perl *nix trick. This means that the correct version of perl must be in the user's PATH e.g. 5.6.1 or later. This version is either shipped with the OS or available on all platforms. On HP/ux, it is available as a depot which is installed in /opt/perl. For CGI perl scripts, the PATH can be set in the admserv.conf, so we may have to do that for HP/ux. To make perldap work, some ugly hacks are involved. Each perl script that uses perldap has a BEGIN section that figures out where it is in the server root, sets a server root variable, and sets LD_LIBRARY_PATH and SHLIB_PATH to point to serverroot/shared/lib. Perldap will be installed under serverroot/lib/perl. This directory will have 3 subdirectories: arch - containing the binary files; auto - containing autoloaded perl modules; and Mozilla - containing the base perldap .pm files. The BEGIN section also sets the perl INC path to find those modules. The directory gets rid of nsperl plus a lot of old crufty perl building code that we do not use anymore. Those are the removed files. The admin server code also gets rid of the perl.c wrapper. Noriko pointed out that this does not take care of upgrade install, so I added several more files and diffs to take care of that case. Basically, go through the tasks in o=netscaperoot and replace perl?scriptname with just scriptname. Also, go through all of the template generated scripts and replace the shebang line with #!/usr/bin/env perl, and make sure they are chmod +x. I also found a few more places that referenced nsperl and removed them. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
Diffstat (limited to 'ldap/admin/src/scripts')
-rwxr-xr-xldap/admin/src/scripts/template-cl-dump.pl17
-rw-r--r--ldap/admin/src/scripts/template-migrate50to5116
-rw-r--r--ldap/admin/src/scripts/template-migrate5to616
-rw-r--r--ldap/admin/src/scripts/template-migrate5to716
-rw-r--r--ldap/admin/src/scripts/template-migrate6to716
-rw-r--r--ldap/admin/src/scripts/template-migrateInstance510
-rw-r--r--ldap/admin/src/scripts/template-migrateInstance610
-rw-r--r--ldap/admin/src/scripts/template-migrateInstance710
-rwxr-xr-xldap/admin/src/scripts/template-migrateTo516
-rw-r--r--ldap/admin/src/scripts/template-migrateTo616
-rw-r--r--ldap/admin/src/scripts/template-migrateTo716
-rwxr-xr-xldap/admin/src/scripts/template-ns-newpwpolicy.pl16
-rwxr-xr-xldap/admin/src/scripts/template-repl-monitor-cgi.pl8
-rwxr-xr-xldap/admin/src/scripts/template-repl-monitor.pl32
-rw-r--r--ldap/admin/src/scripts/template-verify-db.pl13
15 files changed, 185 insertions, 43 deletions
diff --git a/ldap/admin/src/scripts/template-cl-dump.pl b/ldap/admin/src/scripts/template-cl-dump.pl
index 009e6416..747a306a 100755
--- a/ldap/admin/src/scripts/template-cl-dump.pl
+++ b/ldap/admin/src/scripts/template-cl-dump.pl
@@ -96,6 +96,23 @@
# DSHOME/bin/slapd/admin/scripts
#
################################################################################
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
+
$usage="Usage: $0 [-h host] [-p port] [-D bind-dn] [-w bind-password | -P bind-cert] [-r replica-roots] [-o output-file] [-c] [-v]\n\n $0 -i changelog-ldif-file-with-base64encoding [-o output-file] [-c]";
use Getopt::Std; # Parse command line arguments
diff --git a/ldap/admin/src/scripts/template-migrate50to51 b/ldap/admin/src/scripts/template-migrate50to51
index 518a978b..768860e8 100644
--- a/ldap/admin/src/scripts/template-migrate50to51
+++ b/ldap/admin/src/scripts/template-migrate50to51
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 5.0 directory server to a 5.1 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrate5to6 b/ldap/admin/src/scripts/template-migrate5to6
index 63c5774d..9a8b2577 100644
--- a/ldap/admin/src/scripts/template-migrate5to6
+++ b/ldap/admin/src/scripts/template-migrate5to6
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 5.x directory server to a 6.2 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrate5to7 b/ldap/admin/src/scripts/template-migrate5to7
index 622b2216..f2e10e2a 100644
--- a/ldap/admin/src/scripts/template-migrate5to7
+++ b/ldap/admin/src/scripts/template-migrate5to7
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 5.x directory server to a 7.0 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrate6to7 b/ldap/admin/src/scripts/template-migrate6to7
index da799610..284fac9e 100644
--- a/ldap/admin/src/scripts/template-migrate6to7
+++ b/ldap/admin/src/scripts/template-migrate6to7
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 6.x directory server to a 7.0 directory server
#######################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrateInstance5 b/ldap/admin/src/scripts/template-migrateInstance5
index f7224e8a..7c3a7004 100644
--- a/ldap/admin/src/scripts/template-migrateInstance5
+++ b/ldap/admin/src/scripts/template-migrateInstance5
@@ -140,16 +140,6 @@ if (!(-d $serverHome)) {
exit(1);
}
$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ;
-if ($isSolaris9) {
- $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ;
-}
-
-if ($isNT) {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ;
-}
-else {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.005_03${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ;
-}
# get the version of the DS to migrate
($oldVersion, $oldMinor) = &getVersion($oldDir);
diff --git a/ldap/admin/src/scripts/template-migrateInstance6 b/ldap/admin/src/scripts/template-migrateInstance6
index 422e9450..fcca538e 100644
--- a/ldap/admin/src/scripts/template-migrateInstance6
+++ b/ldap/admin/src/scripts/template-migrateInstance6
@@ -144,16 +144,6 @@ if ($olddatadir && !(-d $olddatadir)) {
exit(1);
}
$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ;
-if ($isSolaris9) {
- $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ;
-}
-
-if ($isNT) {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ;
-}
-else {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ;
-}
# get the version of the DS to migrate
($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr);
diff --git a/ldap/admin/src/scripts/template-migrateInstance7 b/ldap/admin/src/scripts/template-migrateInstance7
index 2493a82e..acc0e987 100644
--- a/ldap/admin/src/scripts/template-migrateInstance7
+++ b/ldap/admin/src/scripts/template-migrateInstance7
@@ -144,16 +144,6 @@ if ($olddatadir && !(-d $olddatadir)) {
exit(1);
}
$ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${SEP}".$ENV{"$LIB_PATH"} ;
-if ($isSolaris9) {
- $ENV{"$LIB_PATH"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}sun4-solaris${PATHSEP}CORE${SEP}".$ENV{"$LIB_PATH"} ;
-}
-
-if ($isNT) {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}site${PATHSEP}lib${SEP}".$ENV{"PERL5LIB"} ;
-}
-else {
- $ENV{"PERL5LIB"} = "$root${PATHSEP}lib${PATHSEP}nsPerl5.6.1${PATHSEP}lib${PATHSEP}site${SEP}".$ENV{"PERL5LIB"} ;
-}
# get the version of the DS to migrate
($oldVersion, $oldMinor) = &getVersion($oldDir, $oldversionstr);
diff --git a/ldap/admin/src/scripts/template-migrateTo5 b/ldap/admin/src/scripts/template-migrateTo5
index d9849525..320236ad 100755
--- a/ldap/admin/src/scripts/template-migrateTo5
+++ b/ldap/admin/src/scripts/template-migrateTo5
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a 4.0 directory server to a 5.x directory server
########################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrateTo6 b/ldap/admin/src/scripts/template-migrateTo6
index 2f1c8c95..eeeb9e69 100644
--- a/ldap/admin/src/scripts/template-migrateTo6
+++ b/ldap/admin/src/scripts/template-migrateTo6
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a old directory server to a 6.2 directory server
########################################################################################################
diff --git a/ldap/admin/src/scripts/template-migrateTo7 b/ldap/admin/src/scripts/template-migrateTo7
index 4ee514e8..4a7b2c37 100644
--- a/ldap/admin/src/scripts/template-migrateTo7
+++ b/ldap/admin/src/scripts/template-migrateTo7
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Migrate a old directory server to a 7.0 directory server
########################################################################################################
diff --git a/ldap/admin/src/scripts/template-ns-newpwpolicy.pl b/ldap/admin/src/scripts/template-ns-newpwpolicy.pl
index 55388f33..a15e595d 100755
--- a/ldap/admin/src/scripts/template-ns-newpwpolicy.pl
+++ b/ldap/admin/src/scripts/template-ns-newpwpolicy.pl
@@ -39,6 +39,22 @@
# END COPYRIGHT BLOCK
#
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
+BEGIN {
+ my $sroot = "{{DS-ROOT}}";
+ push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+ if ($ENV{LD_LIBRARY_PATH}) {
+ $ENV{LD_LIBRARY_PATH} .= ":";
+ }
+ $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+ # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+ if ($ENV{SHLIB_PATH}) {
+ $ENV{SHLIB_PATH} .= ":";
+ }
+ $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+}
# Add new password policy specific entries
#############################################################################
diff --git a/ldap/admin/src/scripts/template-repl-monitor-cgi.pl b/ldap/admin/src/scripts/template-repl-monitor-cgi.pl
index ad88c1e6..c9cbd92f 100755
--- a/ldap/admin/src/scripts/template-repl-monitor-cgi.pl
+++ b/ldap/admin/src/scripts/template-repl-monitor-cgi.pl
@@ -56,8 +56,8 @@ if ($cgiVars{'admurl'}) {
$params .= " -u \"$admurl\"";
}
$siteroot = $cgiVars{'siteroot'};
-$perl = "$siteroot/bin/slapd/admin/bin/perl";
-$ENV{'LD_LIBRARY_PATH'} = "$siteroot/lib:$siteroot/lib/nsPerl5.005_03/lib";
+$ENV{'LD_LIBRARY_PATH'} = "$siteroot/shared/lib";
+$ENV{'SHLIB_PATH'} = "$siteroot/shared/lib";
# Save user-specified parameters as cookies in monreplication.properties.
# Sync up with the property file so that monreplication2 is interval, and
@@ -65,8 +65,8 @@ $ENV{'LD_LIBRARY_PATH'} = "$siteroot/lib:$siteroot/lib/nsPerl5.005_03/lib";
$propertyfile = "$siteroot/bin/admin/admin/bin/property/monreplication.properties";
$edit1 = "s#monreplication2=.*#monreplication2=$cgiVars{'refreshinterval'}#;";
$edit2 = "s#^monreplication3=.*#monreplication3=$cgiVars{'configfile'}#;";
-system("$perl -p -i.bak -e \"$edit1\" -e \"$edit2\" $propertyfile");
+system("perl -p -i.bak -e \"$edit1\" -e \"$edit2\" $propertyfile");
# Now the real work
$replmon = "$siteroot/bin/slapd/admin/scripts/template-repl-monitor.pl";
-system("$perl $replmon $params");
+system("perl -I$siteroot/lib/perl/arch -I$siteroot/lib/perl $replmon $params");
diff --git a/ldap/admin/src/scripts/template-repl-monitor.pl b/ldap/admin/src/scripts/template-repl-monitor.pl
index 918c9271..60a7b7bd 100755
--- a/ldap/admin/src/scripts/template-repl-monitor.pl
+++ b/ldap/admin/src/scripts/template-repl-monitor.pl
@@ -146,16 +146,36 @@
# <DSHOME>/bin/slapd/admin/bin/perl repl-monitor.pl
#
# 3. Set environment variable PERL5LIB to your Perl lib dirs where
-# Mozilla::LDAP module can be located.
+# Mozilla::LDAP module can be located. This should be under serverroot/lib/perl
+# e.g. PERL5LIB="serverroot/lib/perl/arch:serverroot/lib/perl"
#
-# 4. Invoke the script as follows if <MYPERLDIR>/lib/site contains
-# Mozilla/LDAP:
-# <MYPERLDIR>/bin/perl -I <MYPERLDIR>/lib/site repl-monitor.pl
+# 4. Set LD_LIBRARY_PATH (or SHLIB_PATH) to point to the location of our
+# bundled shared libraries e.g. LD_LIBRARY_PATH="serverroot/shared/lib"
#
-# If you get error "Can't load ...", try to set environment variable
-# for library path to <DSHOME>/lib:<DSHOME>/lib/nsPerl5.005_03/lib
+# 5. Invoke the script as follows if <MYPERLDIR> (serverroot/lib/perl) contains
+# Mozilla/LDAP:
+# <MYPERLDIR>/bin/perl -I <MYPERLDIR>/arch -I <MYPERLDIR> repl-monitor.pl
#
#############################################################################
+# enable the use of our bundled perldap with our bundled ldapsdk libraries
+# all of this nonsense can be omitted if the mozldapsdk and perldap are
+# 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.
+# BEGIN {
+# my $sroot = "{{DS-ROOT}}";
+# push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+# if ($ENV{LD_LIBRARY_PATH}) {
+# $ENV{LD_LIBRARY_PATH} .= ":";
+# }
+# $ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+# # this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+# if ($ENV{SHLIB_PATH}) {
+# $ENV{SHLIB_PATH} .= ":";
+# }
+# $ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+# }
$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
diff --git a/ldap/admin/src/scripts/template-verify-db.pl b/ldap/admin/src/scripts/template-verify-db.pl
index 4004f5ae..a95ff21e 100644
--- a/ldap/admin/src/scripts/template-verify-db.pl
+++ b/ldap/admin/src/scripts/template-verify-db.pl
@@ -95,6 +95,13 @@ sub getLastLogfile
return \$logfile;
}
+$isWin = -d '\\';
+if ($isWin) {
+ $NULL = "nul";
+} else {
+ $NULL = "/dev/null";
+}
+
print("*****************************************************************\n");
print("verify-db: This tool should only be run if recovery start fails\n" .
"and the server is down. If you run this tool while the server is\n" .
@@ -109,7 +116,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
{
# run ../bin/slapd/server/db_printlog -h <dbdir> for each <dbdir>
print "Verify log files in $$dbdirs[$i] ... ";
- open(PRINTLOG, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_printlog -h $$dbdirs[$i] 2>&1 1> nul |");
+ open(PRINTLOG, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_printlog -h $$dbdirs[$i] 2>&1 1> $NULL |");
sleep 1;
my $haserr = 0;
while ($l = <PRINTLOG>)
@@ -147,7 +154,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
{
my $thisdb = $$dbdirs[$i] . "{{SEP}}" . $db;
print "Verify $thisdb ... ";
- open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> nul |");
+ open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> $NULL |");
sleep 1;
my $haserr = 0;
while ($l = <DBVERIFY>)
@@ -188,7 +195,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
{
my $thisdb = $$instdirs[$j] . "{{SEP}}" . $db;
print "Verify $thisdb ... ";
- open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> null |");
+ open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> $NULL |");
sleep 1;
my $haserr = 0;
while ($l = <DBVERIFY>)