richard: server/perl-kolab/sbin kolab_bootstrap.in,1.14,1.15
cvs at kolab.org
cvs at kolab.org
Wed Dec 30 20:22:22 CET 2009
Author: richard
Update of /kolabrepository/server/perl-kolab/sbin
In directory doto:/tmp/cvs-serv18879/sbin
Modified Files:
kolab_bootstrap.in
Log Message:
Assign the variable lab::config{"is_master"} to prevent warnings
during the execution of kolabconf. Verify if files that are to
be moved or chown'ed exist. If not skip the operation.
Index: kolab_bootstrap.in
===================================================================
RCS file: /kolabrepository/server/perl-kolab/sbin/kolab_bootstrap.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- kolab_bootstrap.in 28 Dec 2009 21:14:22 -0000 1.14
+++ kolab_bootstrap.in 30 Dec 2009 19:22:20 -0000 1.15
@@ -71,6 +71,7 @@
my $kolab_config = "@CONFIG_DIR@/kolab.conf";
my %kolab_config;
+my @files;
##### Utility Functions
@@ -285,7 +286,8 @@
system("mv \"@CONFIG_DIR@/ca\" $backupdir");
}
- system("cd \"@CONFIG_DIR@\"; mv *.pem $backupdir");
+ @files = <@CONFIG_DIR@/*.pem>;
+ system("cd \"@CONFIG_DIR@\"; mv *.pem $backupdir") if (@files);
if (-f $kolab_config) {
system("mv \"$kolab_config\" $backupdir");
@@ -352,6 +354,8 @@
print "Proceeding with master server setup\n\n";
}
+$Kolab::config{"is_master"} = $is_master;
+
if ( $is_master eq "true" ) {
##### Master server setup
getopt('f');
@@ -485,7 +489,8 @@
print "temporarily starting slapd\n";
$ldap_uri = "ldap://127.0.0.1:389/";
# ensure that the database has correct permissions
- system("chown $Kolab::config{'ldapserver_rusr'}:$Kolab::config{'ldapserver_grp'} $Kolab::config{'ldapserver_dir'}/*");
+ @files = <$Kolab::config{'ldapserver_dir'}/*>;
+ system("chown $Kolab::config{'ldapserver_rusr'}:$Kolab::config{'ldapserver_grp'} $Kolab::config{'ldapserver_dir'}/*") if (@files);
(system("$Kolab::config{'libexecdir'}/openldap/slapd -h ldap://127.0.0.1:389/ -f $Kolab::config{'ldapserver_confdir'}/slapd.conf -u $Kolab::config{'ldapserver_rusr'} -g $Kolab::config{'ldapserver_grp'}") == 0 ) || die( "Could not start temporary slapd: $!" );
print ("Waiting for OpenLDAP to start\n");
sleep 10;
More information about the commits
mailing list