richard: server/kolabd/kolabd configure.ac, 1.6, 1.7 ChangeLog, 1.32, 1.33 kolab_bootstrap.in, 1.13, 1.14
cvs at intevation.de
cvs at intevation.de
Wed Jan 4 23:04:01 CET 2006
Author: richard
Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv7412/kolabd
Modified Files:
configure.ac ChangeLog kolab_bootstrap.in
Log Message:
* configure.ac: Added AC_SUBST(WITHOPENPKG)
* dist_conf/common: Added CHKCONFIG, WITHOPENPKG and backupfiles
* dist_conf/suse: Added assignment for backupfiles
* kolab_bootstrap.in: Added one time backup support for configuration
files that are provided by the distributor
Removed a redundant @ldapserver_dir@ statement
Changed removal of *.pem files and the @ldapserver_dir@/* files
Check the existance of files and directories, before moving
Change @sysconfdir@/rc.conf for openpkg based distributions
It works very well on my (non openpkg) system. Please test it on a
openpkg system carefully too!
Index: configure.ac
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/configure.ac,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- configure.ac 30 Dec 2005 19:59:52 -0000 1.6
+++ configure.ac 4 Jan 2006 22:03:59 -0000 1.7
@@ -28,6 +28,13 @@
esac],[openpkg=true])
AM_CONDITIONAL(OPENPKG, test x$openpkg = xtrue)
+if test "x$openpkg" = "xtrue"; then
+ WITHOPENPKG=yes
+else
+ WITHOPENPKG=no
+fi
+AC_SUBST(WITHOPENPKG)
+
# Checks for libraries.
# Checks for header files.
Index: ChangeLog
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/ChangeLog,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- ChangeLog 3 Jan 2006 21:59:08 -0000 1.32
+++ ChangeLog 4 Jan 2006 22:03:59 -0000 1.33
@@ -1,3 +1,14 @@
+2006-01-04 Richard Bos <richard at radoeka.nl>
+ * configure.ac: Added AC_SUBST(WITHOPENPKG)
+ * dist_conf/common: Added CHKCONFIG, WITHOPENPKG and backupfiles
+ * dist_conf/suse: Added assignment for backupfiles
+ * kolab_bootstrap.in: Added one time backup support for configuration
+ files that are provided by the distributor
+ Removed a redundant @ldapserver_dir@ statement
+ Changed removal of *.pem files and the @ldapserver_dir@/* files
+ Check the existance of files and directories, before moving
+ Change @sysconfdir@/rc.conf for openpkg based distributions
+
2006-01-03 Richard Bos <richard at radoeka.nl>
* Makefile.am: distribute only the files to be distributed
from the dist_conf directory.
Index: kolab_bootstrap.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolab_bootstrap.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- kolab_bootstrap.in 1 Jan 2006 21:20:24 -0000 1.13
+++ kolab_bootstrap.in 4 Jan 2006 22:03:59 -0000 1.14
@@ -213,19 +213,38 @@
print "Bootstrapping aborted - not creating new configuration\n";
exit 0;
}
- print "Creating backup of old configuration (LDAP, kolab.conf and certificates\n";
+ print "Creating backup of old configuration (LDAP, kolab.conf and certificates)\n";
+
+ my $backupfiles = "@backupfiles@";
+ if ($backupfiles ne "" && ! -s "@backupdir@/kolab_backup-orig.tar.bz2") {
+ # Do an one time backup. This is to backup the original configuration
+ # files that were configured by user. The one time back is marked with
+ # orig.
+ system("tar cjPf @backupdir@/kolab_backup-orig.tar.bz2 $backupfiles");
+ print "The orginal configuration files have been backed up to:\n";
+ print " @backupdir@/kolab_backup-orig.tar.bz2\n"
+ }
my $epochseconds = timelocal(gmtime);
my $backupdir="@backupdir@/backup".$epochseconds;
mkdir($backupdir,0700) || die "cannot mkdir : $!";
+
print "creating backup of LDAP repository\n";
system("cp -pRP \"@ldapserver_dir@\" \"$backupdir/openldap-data\"");
- system("rm -f \"@ldapserver_dir@/*\"");
+
print "creating backup of CA data\n";
- system("mv \"@sysconfdir@/kolab/ca\" \"$backupdir\"");
- system("mv \"@sysconfdir@/kolab/*.pem\" \"$backupdir\"");
- system("mv \"$kolab_config\" \"$backupdir\"");
+ if (-d "@sysconfdir@/kolab/ca") {
+ system("mv \"@sysconfdir@/kolab/ca\" $backupdir");
+ }
+
+ system("cd \"@sysconfdir@/kolab\"; mv *.pem $backupdir");
+
+ if (-f $kolab_config) {
+ system("mv \"$kolab_config\" $backupdir");
+ }
+
print "Cleaning up LDAP\n";
- system("rm -f \"@ldapserver_dir@/*\"");
+ system("cd \"@ldapserver_dir@\"; rm -f *");
+
} else {
print "LDAP repository is empty - assuming fresh install\n";
}
@@ -605,18 +624,23 @@
print "Create initial config files for postfix, apache, proftpd, cyrus imap, saslauthd\n";
- my $cfg;
- open(FH, "<@sysconfdir@/rc.conf") || die;
- $cfg .= $_ while (<FH>);
- close(FH);
+ if ("@WITHOPENPKG@" eq "yes") {
+ # @sysconfdir@/rc.conf can be used to change the startup behaviour
+ # of programs, that have been installed with openpkg. On non openpkg
+ # this could be done with e.g. /etc/sysconfig/ldap.
+ my $cfg;
+ open(FH, "<@sysconfdir@/rc.conf") || die;
+ $cfg .= $_ while (<FH>);
+ close(FH);
- $cfg =~ s/\n((openldap_url|sasl_authmech)\S*=[^\n]*)/#$1\n/sg;
- $cfg .= "openldap_url=\"ldap:// ldaps://\"\nsasl_authmech=\"ldap\"\n";
+ $cfg =~ s/\n((openldap_url|sasl_authmech)\S*=[^\n]*)/#$1\n/sg;
+ $cfg .= "openldap_url=\"ldap:// ldaps://\"\nsasl_authmech=\"ldap\"\n";
- open(FH, ">@sysconfdir@/rc.conf") || die;
- print FH $cfg;
- close(FH);
- undef $cfg;
+ open(FH, ">@sysconfdir@/rc.conf") || die;
+ print FH $cfg;
+ close(FH);
+ undef $cfg;
+ }
#print " running @sysconfdir@/kolab/kolab -v -o -l$ldap_uri\n";
print "running @sbindir@/kolabconf -n\n";
More information about the commits
mailing list