gunnar: server/perl-kolab/Kolab Kolab.pm.in,1.7,1.8
cvs at kolab.org
cvs at kolab.org
Tue Jul 31 13:54:35 CEST 2007
Author: gunnar
Update of /kolabrepository/server/perl-kolab/Kolab
In directory doto:/tmp/cvs-serv26549/perl-kolab/Kolab
Modified Files:
Kolab.pm.in
Log Message:
Removed knowledge of the kolabd package from the Kolab.pm script.
Index: Kolab.pm.in
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab/Kolab.pm.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Kolab.pm.in 26 Jul 2007 15:17:56 -0000 1.7
+++ Kolab.pm.in 31 Jul 2007 11:54:33 -0000 1.8
@@ -27,7 +27,7 @@
use Net::LDAP;
use Kolab::Util;
#use Kolab::LDAP;
-use vars qw(%config %haschanged $reloadOk);
+use vars qw(%config $reloadOk);
require Exporter;
@@ -63,6 +63,8 @@
sub reloadConfig
{
+ my $kolab_globals = shift;
+
my $tempval;
my $ldap;
@@ -76,23 +78,25 @@
# 3 - Info, Warnings & Errors (DEFAULT)
# 4 - Debug (i.e. everything)
+ # First read `kolab.globals'
+ %config = readConfig(%config, $kolab_globals);
+
# Determine the root of the kolab installation, and read `kolab.globals'
# Notice that the location of the files is handled by dist_conf,
# so we don't use $tempval for anything other than storing it in
# $config{'prefix'}. Once prefix is not in use anywhere, we can remove
# this code. /steffen
- $tempval = (getpwnam('@kolab_musr@'))[7];
+ $tempval = (getpwnam($config{'kolab_musr'}))[7];
if (! defined $tempval) {
$config{'log_level'} = KOLAB_WARN;
&log('C', 'Unable to determine the kolab user main directory', KOLAB_ERROR);
$error = 1;
} else {
- %config = readConfig(%config, "@sysconfdir@/kolab/kolab.globals");
- $config{'prefix'} = $tempval;
+ $config{'prefix'} = $tempval;
}
# Now read `kolab.conf', overwriting values read from `kolab.globals'
- %config = readConfig(\%config, "@sysconfdir@/kolab/kolab.conf");
+ %config = readConfig(\%config, $config{'kolab_locals'});
$config{'debug'} = 0 if (!exists $config{'debug'});
$config{'log_level'} = KOLAB_WARN if (!exists $config{'log_level'});
@@ -100,39 +104,39 @@
&log('C', 'Reloading configuration');
# Get the UID/GID of the 'kolab' users
- $config{'kolab_uid'} = (getpwnam('@kolab_musr@'))[2];
+ $config{'kolab_uid'} = (getpwnam($config{'kolab_musr'}))[2];
if (!defined $config{'kolab_uid'}) {
- &log('C', "Unable to determine the uid of user '@kolab_musr@'", KOLAB_ERROR);
+ &log('C', "Unable to determine the uid of user '$config{'kolab_musr'}'", KOLAB_ERROR);
$error = 1;
}
- $config{'kolab_gid'} = (getgrnam('@kolab_mgrp@'))[2];
+ $config{'kolab_gid'} = (getgrnam($config{'kolab_mgrp'}))[2];
if (!defined $config{'kolab_gid'}) {
- &log('C', "Unable to determine the gid of user '@kolab_mgrp@'", KOLAB_ERROR);
+ &log('C', "Unable to determine the gid of user '$config{'kolab_mgrp'}'", KOLAB_ERROR);
$error = 1;
}
- $config{'kolab_n_uid'} = (getpwnam('@kolab_usr@'))[2];
+ $config{'kolab_n_uid'} = (getpwnam($config{'kolab_usr'}))[2];
if (!defined $config{'kolab_n_uid'}) {
- &log('C', "Unable to determine the uid of user '@kolab_usr@'", KOLAB_ERROR);
+ &log('C', "Unable to determine the uid of user '$config{'kolab_usr'}", KOLAB_ERROR);
$error = 1;
}
- $config{'kolab_n_gid'} = (getgrnam('@kolab_grp@'))[2];
+ $config{'kolab_n_gid'} = (getgrnam($config{'kolab_grp'}))[2];
if (!defined $config{'kolab_n_gid'}) {
- &log('C', "Unable to determine the gid of user @kolab_grp@'", KOLAB_ERROR);
+ &log('C', "Unable to determine the gid of user $config{'kolab_grp'}", KOLAB_ERROR);
$error = 1;
}
- $config{'kolab_r_uid'} = (getpwnam('@kolab_rusr@'))[2];
+ $config{'kolab_r_uid'} = (getpwnam($config{'kolab_rusr'}))[2];
if (!defined $config{'kolab_r_uid'}) {
- &log('C', "Unable to determine the uid of user '@kolab_rusr@'", KOLAB_ERROR);
+ &log('C', "Unable to determine the uid of user '$config{'kolab_rusr'}'", KOLAB_ERROR);
$error = 1;
}
- $config{'kolab_r_gid'} = (getgrnam('@kolab_rgrp@'))[2];
+ $config{'kolab_r_gid'} = (getgrnam($config{'kolab_rgrp'}))[2];
if (!defined $config{'kolab_r_gid'}) {
- &log('C', "Unable to determine the gid of user '@kolab_rgrp@'", KOLAB_ERROR);
+ &log('C', "Unable to determine the gid of user '$config{'kolab_rgrp'}'", KOLAB_ERROR);
$error = 1;
}
@@ -144,7 +148,7 @@
# Make a hash of the bind password available too
if( !exists $config{'bind_pw_hash'} ) {
- my $hashcmd = "@sbindir@/slappasswd -s '".$config{'bind_pw'}."'";
+ my $hashcmd = $config{'hashmethod'} . " '".$config{'bind_pw'}."'";
$config{'bind_pw_hash'} = `$hashcmd`;
chomp($config{'bind_pw_hash'});
}
@@ -393,61 +397,6 @@
$reloadOk = !$error;
}
-sub reload
-{
- if ($haschanged{'slapd'}) {
- &log('K', 'Restarting OpenLDAP...');
- system("@KOLABRC@ rc openldap restart &");
- }
-
- if ($haschanged{'saslauthd'}) {
- &log('K', 'Restarting SASLAuthd...');
- system("@KOLABRC@ rc sasl stop; sleep 1; @sbindir@/saslauthd -a ldap -n 5");
- }
-
- if ($haschanged{'apache'}) {
- &log('K', 'Reloading Apache...');
- system("@sbindir@/apachectl graceful");
- }
-
- if ($haschanged{'postfix'}) {
- &log('K', 'Reloading Postfix...');
- system("@sbindir@/postfix reload");
- }
-
- if ($haschanged{'imapd'}) {
- &log('K', 'Restarting imapd...');
- # Would it be enough with a reload here? /steffen
- system("@KOLABRC@ rc imapd restart");
- }
-
- if ($haschanged{'amavisd'}) {
- &log('K', 'Restarting amavisd...');
- system("@KOLABRC@ rc amavisd restart");
- }
-
- if ($haschanged{'clamav'}) {
- &log('K', 'Restarting clamav...');
- system("@KOLABRC@ rc clamav restart");
- }
-
- if ($config{'proftpd-ftp'} =~ /true/i) {
- Kolab::log('K', 'Starting ProFTPd if not running');
- system("@KOLABRC@ rc proftpd start");
- if ($haschanged{'proftpd'}) {
- &log('K', 'Reloading ProFTPd...');
- kill('SIGHUP', `cat @ftpserver_pidfile@`);
- }
- } else {
- &log('K', 'Stopping ProFTPd, if running...');
- system("@KOLABRC@ rc proftpd stop");
- }
-
- %Kolab::Conf::haschanged = ();
-
- &log('K', 'Reload finished');
-}
-
sub log
{
my $prefix = shift;
@@ -469,8 +418,6 @@
}
print STDERR "$text\n" if ($config{'debug'});
}
-
-reloadConfig();
1;
__END__
More information about the commits
mailing list