AW: [Kolab-devel] Re: kolab_bootstrap -b fails on Solaris 8 Sparc
soliva at comcept.ch
soliva at comcept.ch
Mon Oct 3 17:06:23 CEST 2005
Hello
I do not know if I can help in this case but a friend did some investigation
of that problem and found out the following:
As problematic syscalls I see:
Problems in /kolab/etc/kolab/kolab_bootstrap
ps aux
cp -pRP
Problems in kolab/lib/perl/vendor_perl/5.8.7/Kolab/Conf.pm
[root at kolab2 /kolab/lib/perl/vendor_perl/5.8.7/Kolab]# grep diff * | uniq
Conf.pm: my $rc = `diff -q $cfg $oldcfg`;
[root at kolab2 /kolab/lib/perl/vendor_perl/5.8.7/Kolab]#
Below you will find kind of a trace how I found the offending syscalls....
### FIND ALL SYSCALLS IN /kolab/etc/kolab/kolab_bootstrap
[root at kolab2 /kolab/etc/kolab]# egrep '`|system|qw'
/kolab/etc/kolab/kolab_bootstrap | grep -v \# | sed "s/^[ \t]*//g" | sort |
uniq
$bind_pw = `$kolab_prefix/bin/openssl rand -base64 12`;
$calendar_pw = `$kolab_prefix/bin/openssl rand -base64 30`;
$host = `hostname`;
$php_pw = `$kolab_prefix/bin/openssl rand -base64 30`;
(my $hashpw = `$hashcmd`) or die $@;
(system("$kolab_prefix/libexec/openldap/slapd -h ldap://127.0.0.1:389/ -f
$kolab_prefix/etc/openldap/slapd.conf") == 0 ) || die( "Could not start
temporary slapd" );
if( `ps aux|grep slurpd|grep -elf grep` ) {
kolab_system("$kolab_prefix/bin/openpkg rc openldap stop");
kolab_system("$kolab_prefix/etc/kolab/kolab_ca.sh -newca $fqdn");
kolab_system("$kolab_prefix/etc/kolab/kolab_ca.sh -newkey $fqdn
$kolab_prefix/etc/kolab/key.pem");
kolab_system("$kolab_prefix/etc/kolab/kolab_ca.sh -newreq $fqdn
$kolab_prefix/etc/kolab/key.pem $kolab_prefix/etc/kolab/newreq.pem ");
kolab_system("$kolab_prefix/etc/kolab/kolab_ca.sh -sign
$kolab_prefix/etc/kolab/newreq.pem $kolab_prefix/etc/kolab/cert.pem");
kolab_system("$kolab_prefix/sbin/kolabconf -n");
kolab_system("/kolab/bin/openssl genrsa -out $privreskey 1024");
kolab_system("/kolab/bin/openssl rsa -in $privreskey -pubout -out
$pubreskey");
kolab_system("chgrp kolab-r $kolab_prefix/etc/kolab/cert.pem;");
kolab_system("chgrp kolab-r $kolab_prefix/etc/kolab/key.pem;");
kolab_system("chmod 0640 $kolab_prefix/etc/kolab/cert.pem;");
kolab_system("chmod 0640 $kolab_prefix/etc/kolab/key.pem;");
kolab_system("chown kolab:kolab-n $pubreskey $privreskey");
kolab_system("scp $kolab_prefix/etc/kolab/newreq.pem
$master_host:$kolab_prefix/etc/kolab/$fqdn-req.pem");
kolab_system("scp $master_host:$kolab_prefix/etc/kolab/$fqdn.pem
$kolab_prefix/etc/kolab/cert.pem");
kolab_system("scp $master_host:$privreskey "
kolab_system("ssh -CA $master_host $kolab_prefix/bin/openpkg rc openldap
start");
kolab_system("ssh -CA $master_host $kolab_prefix/bin/openpkg rc openldap
stop");
kolab_system("ssh -CA $master_host $kolab_prefix/lib/openpkg/tar -C
$kolab_prefix/var/openldap -pcf - openldap-data |
$kolab_prefix/lib/openpkg/tar -C $kolab_prefix/var/openldap -pxf -");
kolab_system("ssh -CA $master_host \"$kolab_prefix/etc/kolab/kolab_ca.sh
-sign $kolab_prefix/etc/kolab/$fqdn-req.pem
$kolab_prefix/etc/kolab/$fqdn.pem;\"");
kolab_system("ssh -CA $master_host \"rm $kolab_prefix/etc/kolab/$fqdn.pem
$kolab_prefix/etc/kolab/$fqdn-req.pem\"");
or die "system $arg failed: $?";
sub kolab_system {
system( $arg ) == 0
system("$kolab_prefix/etc/rc openldap stop");
system("$kolab_prefix/sbin/kolabconf -n");
system("cp -pRP ".$kolab_prefix."/var/openldap/openldap-data/
".$backupdir."/openldap-data");
system("killall -9 slapd >/dev/null 2>&1");
system("mv ".$kolab_prefix."/etc/kolab/*.pem ".$backupdir);
system("mv ".$kolab_prefix."/etc/kolab/ca ".$backupdir);
system("mv $kolab_config $backupdir");
system("rm -f ".$kolab_prefix."/var/openldap/openldap-data/*");
system($kolab_prefix."/sbin/slapcat >/dev/null 2>&1");
use vars qw($opt_b $opt_f);
[root at kolab2 /kolab/etc/kolab]#
###############################################
# therefore these are the syscalls:
--- may be a problem
+++ should be ok
################################################
+++ $kolab_prefix/bin/openssl rand -base64 12
+++ $kolab_prefix/bin/openssl rand -base64 30
+++ hostname
+++ $kolab_prefix/bin/openssl rand -base64 30
+++ $kolab_prefix/libexec/openldap/slapd -h ldap://127.0.0.1:389/ -f
$kolab_prefix/etc/openldap/slapd.conf
--- ps aux
+++ grep slurpd
+++ $kolab_prefix/bin/openpkg rc openldap stop
# here another script is called (we have to trace this script also)
$kolab_prefix/etc/kolab/kolab_ca.sh -newca $fqdn");
$kolab_prefix/etc/kolab/kolab_ca.sh -newkey $fqdn
$kolab_prefix/etc/kolab/key.pem");
$kolab_prefix/etc/kolab/kolab_ca.sh -newreq $fqdn
$kolab_prefix/etc/kolab/key.pem $kolab_prefix/etc/kolab/newreq.pem ");
$kolab_prefix/etc/kolab/kolab_ca.sh -sign $kolab_prefix/etc/kolab/newreq.pem
$kolab_prefix/etc/kolab/cert.pem");
# here another script is called (we have to trace this script also)
# since this perl-script don't use syscalls the problem must be in the
Perl-Modules
--- $kolab_prefix/sbin/kolabconf -n -> this script dont use any system
tools but a kolab-perl-module
+++ /kolab/bin/openssl genrsa -out $privreskey 1024
+++ /kolab/bin/openssl rsa -in $privreskey -pubout -out $pubreskey
+++ chgrp kolab-r $kolab_prefix/etc/kolab/cert.pem
+++ chgrp kolab-r $kolab_prefix/etc/kolab/key.pem
+++ chmod 0640 $kolab_prefix/etc/kolab/cert.pem
+++ chmod 0640 $kolab_prefix/etc/kolab/key.pem
+++ chown kolab:kolab-n $pubreskey $privreskey
+++ scp $kolab_prefix/etc/kolab/newreq.pem
$master_host:$kolab_prefix/etc/kolab/$fqdn-req.pem
+++ scp $master_host:$kolab_prefix/etc/kolab/$fqdn.pem
$kolab_prefix/etc/kolab/cert.pem
+++ scp $master_host:$privreskey
+++ ssh -CA $master_host $kolab_prefix/bin/openpkg rc openldap start
+++ ssh -CA $master_host $kolab_prefix/bin/openpkg rc openldap stop
+++ ssh -CA $master_host $kolab_prefix/lib/openpkg/tar -C
$kolab_prefix/var/openldap -pcf - openldap-data
+++ $kolab_prefix/lib/openpkg/tar -C $kolab_prefix/var/openldap -pxf -
+++ ssh -CA $master_host \"$kolab_prefix/etc/kolab/kolab_ca.sh -sign
$kolab_prefix/etc/kolab/$fqdn-req.pem $kolab_prefix/etc/kolab/$fqdn.pem;\"
+++ ssh -CA $master_host \"rm $kolab_prefix/etc/kolab/$fqdn.pem
$kolab_prefix/etc/kolab/$fqdn-req.pem\"
+++ $kolab_prefix/etc/rc openldap stop
# here another script is called (we have to trace this script also)
# since this perl-script don't use syscalls the problem must be in the
Perl-Modules
--- $kolab_prefix/sbin/kolabconf -n
--- cp -pRP ".$kolab_prefix."/var/openldap/openldap-data/
".$backupdir."/openldap-data
+++ killall -9 slapd
+++ mv ".$kolab_prefix."/etc/kolab/*.pem ".$backupdir
+++ mv ".$kolab_prefix."/etc/kolab/ca ".$backupdir
+++ mv $kolab_config $backupdir
+++ rm -f ".$kolab_prefix."/var/openldap/openldap-data/*
+++ $kolab_prefix."/sbin/slapcat
################### EOF
I hope this helps in the next steps to find the none posix commands!
Andrea
-----Ursprüngliche Nachricht-----
Von: kolab-devel-bounces at kolab.org [mailto:kolab-devel-bounces at kolab.org] Im
Auftrag von Bernhard Reiter
Gesendet: Sonntag, 2. Oktober 2005 16:53
An: kolab-devel at kolab.org
Betreff: Re: [Kolab-devel] Re: kolab_bootstrap -b fails on Solaris 8 Sparc
Am Dienstag, 27. September 2005 23:17 schrieb Thomas Arendsen Hein:
> * soliva at comcept.ch <soliva at comcept.ch> [20050927 21:41]:
> > diff: illegal option -- q
> > usage: diff [-bitw] [-c | -e | -f | -h | -n] file1 file2
> > diff [-bitw] [-C number] file1 file2
> > diff [-bitw] [-D string] file1 file2
> > diff [-bitw] [-c | -e | -f | -h | -n] [-l] [-r] [-s] [-S name]
> > directory1 directory2
>
> There are some calls to 'diff -q' in
> /kolab/lib/perl/site_perl/5.8.7/i686-linux/Kolab/Conf.pm
> that look like this:
> my $rc = `diff -q $cfg $oldcfg`;
> please try changing them to:
> my $rc = `diff $cfg $oldcfg >/dev/null`;
This looks okay for posix with me.
Andrea: Can you retry with Thomas changes for diff
and my correction for the ps change?
Steffen: Are you okay with the change? Then you can commit it.
_______________________________________________
Kolab-devel mailing list
Kolab-devel at kolab.org
https://kolab.org/mailman/listinfo/kolab-devel
More information about the devel
mailing list