summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 260df07)
raw | patch | inline | side by side (parent: 260df07)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 May 2010 13:02:47 +0000 (13:02 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 May 2010 13:02:47 +0000 (13:02 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18516 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/modules/DBsqlite.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 1885d301170810d58a803fac59e3c1ea313d4edf..3f369825d2b1995db620fc5c711d1beec48bb0fd 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
my %repo_dirs=();
# Variables declared in config file are always set to 'our'
-our (%cfg_defaults, $log_file, $pid_file, $pid
+our (%cfg_defaults, $log_file, $pid_file, $pid,
$server_ip, $server_port, $ClientPackages_key, $dns_lookup,
$arp_activ, $gosa_unit_tag,
$GosaPackages_key, $gosa_timeout,
'vvv': warning plus error logs
'vvvvv': info plus warning logs
'vvvvvvv': debug plus info logs
- -no-arp : starts $prg without connection to arp module
+ -no-arp : starts gosa-si-server without connection to arp module
-d <int> : if verbose level is higher than 7x 'v' specified parts can be debugged
1 : report incoming messages
2 : report unencrypted outgoing messages
# Build log message and write it to log file and commandline
chomp($msg);
- my $log_msg = "$month $monthday $hours:$minutes:$seconds$microSeconds $prg $msg\n";
+ my $log_msg = "$month $monthday $hours:$minutes:$seconds$microSeconds $0 $msg\n";
flock(LOG_HANDLE, LOCK_EX);
seek(LOG_HANDLE, 0, 2);
print LOG_HANDLE $log_msg;
# to be removed rather crude !!
#system("kill `ps -C gosa-si-server -o pid=`");
- $pid->remove or warn "Could not remove $pidfile\n";
+ $pid->remove or warn "Could not remove $pid_file\n";
exit(0);
}
'h|help' => \&usage,
'c|config=s' => \$config,
'x|dump-config=i' => \$dump_config,
- 'f|foreground' => \$foreground)
- 'd=s' => \$debug_parts,
+ 'f|foreground' => \$foreground,
+ 'd=s' => \$debug_parts)
or usage( '', 1 );
# We may want to dump the default configuration
# Create the PID object
# Ensure you put a name that won't clobber
# another program's PID file
-my $pid = File::Pid->new({
- file => $pidfile,
+$pid = File::Pid->new({
+ file => $pid_file,
});
# Write the PID file
umask 0;
#} else {
# $pid = $$;
-#}
+}
# Do something useful - put our PID into the pid_file
#if( 0 != $pid ) {
index 31f2c395df3df665069bfe9dd80534458266beea..8e3784df7cab92b024fe4cc5d4aaaf34f1298db9 100644 (file)
sub connect {
my $self = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::connect was called static! Argument was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::connect was called static! Argument was '$self'!", 1);
return;
}
sub disconnect {
my $self = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::disconnect was called static! Argument was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::disconnect was called static! Argument was '$self'!", 1);
return;
}
sub lock {
my $self = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::lock was called static! Argument was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::lock was called static! Argument was '$self'!", 1);
return;
}
sub unlock {
my $self = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::unlock was called static! Argument was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::unlock was called static! Argument was '$self'!", 1);
return;
}
if(not ref $self->{db_lock_handle}) {
sub create_table {
my $self = shift;
if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::create_table was called static! Statement was '$self'!", 1);
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::create_table was called static! Statement was '$self'!", 1);
return;
}
my $table_name = shift;
sub update_dbentry {
my ($self, $sql)= @_;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::update_dbentry was called static! Statement was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::update_dbentry was called static! Statement was '$self'!", 1);
return;
}
my $db_answer= $self->exec_statement($sql);
sub del_dbentry {
my ($self, $sql)= @_;;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::del_dbentry was called static! Statement was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::del_dbentry was called static! Statement was '$self'!", 1);
return;
}
my $db_res= $self->exec_statement($sql);
sub get_table_columns {
my $self = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::get_table_columns was called static! Statement was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::get_table_columns was called static! Statement was '$self'!", 1);
return;
}
my $table = shift;
sub select_dbentry {
my ($self, $sql)= @_;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::select_dbentry was called static! Statement was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::select_dbentry was called static! Statement was '$self'!", 1);
return;
}
my $error= 0;
sub show_table {
my $self = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::show_table was called static! Statement was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::show_table was called static! Statement was '$self'!", 1);
return;
}
my $table_name = shift;
sub exec_statement {
my $self = shift;
my $sql_statement = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statement was called static! Statement was '$self'!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::exec_statement was called static! Statement was '$self'!", 1);
return;
}
if(not defined($sql_statement) or length($sql_statement) == 0) {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statement was called with empty statement!", 1);
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::exec_statement was called with empty statement!", 1);
return;
}
sub exec_statementlist {
my $self = shift;
my $sql_list = shift;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statementlist was called static!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::exec_statementlist was called static!", 1);
return;
}
my @db_answer;
sub count_dbentries {
my ($self, $table)= @_;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::count_dbentries was called static!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::count_dbentries was called static!", 1);
return;
}
my $error= 0;
sub move_table {
my ($self, $from, $to) = @_;
- if(not defined($self) or ref($self) ne 'GOSA::DBsqlite') {
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::move_table was called static!", 1);
+ if(not defined($self) or ref($self) ne 'GOsaSI::DBsqlite') {
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::move_table was called static!", 1);
return;
}
};
if($@) {
$self->{dbh}->rollback();
- &main::daemon_log("0 ERROR: GOSA::DBsqlite::move_table crashed! Operation failed with $@", 1);
+ &main::daemon_log("0 ERROR: GOsaSI::DBsqlite::move_table crashed! Operation failed with $@", 1);
}
}
- &main::daemon_log("0 INFO: GOSA::DBsqlite::move_table: Operation successful!", 7);
+ &main::daemon_log("0 INFO: GOsaSI::DBsqlite::move_table: Operation successful!", 7);
$self->unlock();
return;