Changeset 25027 for branches/pap/DataStoreServer/scripts/dsreg
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
DataStoreServer/scripts/dsreg (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/DataStoreServer/scripts/dsreg
r23902 r25027 102 102 } 103 103 if (($linkfiles or $copyfiles) and !$datapath and !$abspath) { 104 $err .= "need to specify datapath with --link or--copy\n";105 } 106 if ( $linkfiles && (substr($datapath, 0, 1) ne "/")) {104 $err .= "need to specify datapath or abspath with --link and --copy\n"; 105 } 106 if (!$abspath && $linkfiles && (substr($datapath, 0, 1) ne "/")) { 107 107 $err .= "datapath must begin with / when using --link\n"; 108 108 } … … 137 137 unless defined stat("$dsroot/$product/index.txt"); 138 138 139 $dbname = metadataLookupStr($siteConfig, 'D BNAME') unless defined $dbname;140 my $dbserver = metadataLookupStr($siteConfig, 'D BSERVER');141 my $dbuser = metadataLookupStr($siteConfig, 'D BUSER');142 my $dbpass = metadataLookupStr($siteConfig, 'D BPASSWORD');139 $dbname = metadataLookupStr($siteConfig, 'DS_DBNAME') unless defined $dbname; 140 my $dbserver = metadataLookupStr($siteConfig, 'DS_DBSERVER'); 141 my $dbuser = metadataLookupStr($siteConfig, 'DS_DBUSER'); 142 my $dbpass = metadataLookupStr($siteConfig, 'DS_DBPASSWORD'); 143 143 exit ($PS_EXIT_CONFIG_ERROR) unless defined $dbserver and $dbname and $dbuser and $dbpass; 144 144 145 145 my $dsn = "DBI:mysql:host=$dbserver;database=$dbname"; 146 my %conn_attrs = (PrintError => 1, RaiseError => 1, AutoCommit => 0); 146 # mysql cookbook says 'PrintError can interfere with failure detection in some cases' 147 my %conn_attrs = (PrintError => 0, RaiseError => 1, AutoCommit => 0); 147 148 148 149 my $dbh = DBI->connect_cached($dsn, $dbuser, $dbpass, \%conn_attrs) … … 211 212 if ($@) { # an error occured 212 213 print STDERR "transaction failed, rolling back error was:\n$@\n"; 214 # roll back within eval to prevent rollback failure from terminating the script 213 215 eval {$dbh->rollback();}; 214 216 cleanup(); … … 476 478 --copy Copy files from datapath to Data Store 477 479 --datapath path to source files for --copy or --link 480 --abspath path to source files is absoloute (--datapath not needed) 478 481 --ps0 - ps7 Optional product specific data 479 482 --rm with --del remove the fileset directory from the Data Store
Note:
See TracChangeset
for help on using the changeset viewer.
