summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: caf8b80)
raw | patch | inline | side by side (parent: caf8b80)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Feb 2008 15:50:07 +0000 (15:50 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Feb 2008 15:50:07 +0000 (15:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8876 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-bus | patch | blob | history | |
gosa-si/gosa-si-client | patch | blob | history | |
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/modules/DBsqlite.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-bus b/gosa-si/gosa-si-bus
index 7d436d3068ae6b814af21963ef2c163c3ae19e35..a9ae07261e929c0c4fff58732c3bad79cd5e87fa 100755 (executable)
--- a/gosa-si/gosa-si-bus
+++ b/gosa-si/gosa-si-bus
use NetAddr::IP;
use XML::Simple;
use MIME::Base64;
+use File::Basename;
use Digest::MD5 qw(md5 md5_hex md5_base64);
@@ -41,12 +42,13 @@ my ($cfg_file, $default_cfg_file, %cfg_defaults, $foreground, $verbose, $pid_fil
my ($bus_address, $bus_key, $bus_ip, $bus_port, $bus_mac_address);
my ($bus_known_server_db, $bus_known_server_file_name, $bus_known_clients_db, $bus_known_clients_file_name);
my $xml;
+our $prg= basename($0);
$foreground = 0 ;
%cfg_defaults = (
"general" => {
- "log_file" => [\$log_file, "/var/run/".$0.".log"],
- "pid_file" => [\$pid_file, "/var/run/".$0.".pid"],
+ "log_file" => [\$log_file, "/var/run/".$prg.".log"],
+ "pid_file" => [\$pid_file, "/var/run/".$prg.".pid"],
},
"bus" => {
"key" => [\$bus_key, "secret-bus-password"],
#===============================================================================
sub usage {
print STDERR << "EOF" ;
-usage: $0 [-hvf] [-c config]
+usage: $prg [-hvf] [-c config]
-h : this (help) message
-c <file> : config file
$month = $monthnames[$month];
$monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
$year+=1900;
- my $name = $0;
- $name =~ s/\.\///;
- my $log_msg = "$month $monthday $hours:$minutes:$seconds $name $msg\n";
+ my $log_msg = "$month $monthday $hours:$minutes:$seconds $prg $msg\n";
print LOG_HANDLE $log_msg;
if( $foreground ) {
print STDERR $log_msg;
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 454b1b765996b4ee94a73cdd8e317d7b1b17d6dc..f36c77f7724e0129666b3330d6f6bb628b4b763a 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
use MIME::Base64;
use XML::Simple;
use Net::DNS;
+use File::Basename;
my $event_dir = "/usr/lib/gosa-si/client/events";
use lib "/usr/lib/gosa-si/client/events";
# in function register_at_gosa_si_server, after which period of seconds a new registration should be tried if a registration was
# not successful until now
my $delay_set_time = 5;
+our $prg= basename($0);
%cfg_defaults = (
"general" =>
- {"log-file" => [\$log_file, "/var/run/".$0.".log"],
- "pid-file" => [\$pid_file, "/var/run/".$0.".pid"],
- "opts-file" => [\$opts_file, "/var/run/".$0.".opts"],
+ {"log-file" => [\$log_file, "/var/run/".$prg.".log"],
+ "pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
+ "opts-file" => [\$opts_file, "/var/run/".$prg.".opts"],
},
"client" =>
{"port" => [\$client_port, "20083"],
$month = $monthnames[$month];
$monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
$year+=1900;
- my $name = $0;
- $name =~ s/\.\///;
- my $log_msg = "$month $monthday $hours:$minutes:$seconds $name $msg\n";
+ my $log_msg = "$month $monthday $hours:$minutes:$seconds $prg $msg\n";
print LOG_HANDLE $log_msg;
if( $foreground ) {
print STDERR $log_msg;
my $error = 0;
if( not defined $file || not -f $file ) {
- &main::daemon_log("ERROR: $0: check '-f file' failed: $file", 1);
+ &main::daemon_log("ERROR: $prg: check '-f file' failed: $file", 1);
$error++;
}
if( not defined $string || 0 == length($string)) {
- &main::daemon_log("ERROR: $0: empty string to write to file '$file'", 1);
+ &main::daemon_log("ERROR: $prg: empty string to write to file '$file'", 1);
$error++;
}
}
daemon_log(" ", 1);
-daemon_log("$0 started!", 1);
+daemon_log("$prg started!", 1);
# delete old DBsqlite lock files
system('rm -f /tmp/gosa_si_lock*gosa-si-client*');
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 04063e6f320286aeca851f38587d2fa843824c3a..127d8b65ea6d0b28c4ace28db4e9932c01abf466 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
use Sys::Syslog qw( :DEFAULT setlogsock);
use Cwd;
use File::Spec;
+use File::Basename;
use GOSA::DBsqlite;
use POE qw(Component::Server::TCP);
# holds all registrated clients
our $known_clients_db;
+our $prg= basename($0);
%cfg_defaults = (
"general" => {
- "log-file" => [\$log_file, "/var/run/".$0.".log"],
- "pid-file" => [\$pid_file, "/var/run/".$0.".pid"],
+ "log-file" => [\$log_file, "/var/run/".$prg.".log"],
+ "pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
},
"bus" => {
"activ" => [\$bus_activ, "true"],
#===============================================================================
sub usage {
print STDERR << "EOF" ;
-usage: $0 [-hvf] [-c config]
+usage: $prg [-hvf] [-c config]
-h : this (help) message
-c <file> : config file
-f : foreground, process will not be forked to background
-v : be verbose (multiple to increase verbosity)
- -no-bus : starts $0 without connection to bus
- -no-arp : starts $0 without connection to arp module
+ -no-bus : starts $prg without connection to bus
+ -no-arp : starts $prg without connection to arp module
EOF
print "\n" ;
$month = $monthnames[$month];
$monthday = $monthday < 10 ? $monthday = "0".$monthday : $monthday;
$year+=1900;
- my $name = $0;
- $name =~ s/\.\///;
+ my $name = $prg;
my $log_msg = "$month $monthday $hours:$minutes:$seconds $name $msg\n";
print LOG_HANDLE $log_msg;
index 206620c7cc91286652a0e32eaf16dd38962fe98e..95ac1b68bc04fa5251ae5808bfe52101eaf2a801 100644 (file)
my $class = shift;
my $db_name = shift;
- my $lock = $db_name.".gosa_lock";
+ my $lock = $db_name.".lock";
# delete existing lock - instance should be running only once
if(stat($lock)) {
unlink($lock);