From 0e6100af7e44aee672865d3ee6bf7bae9e9e85a5 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Wed, 7 May 2008 15:43:13 +0000 Subject: [PATCH] add client version to registration process and daemon_log git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10826 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 21 ++++++++++++++++++++- gosa-si/modules/SIPackages.pm | 6 +++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 8a897ebee..7c689a322 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -52,7 +52,11 @@ use Net::LDAP::Util qw(:escape); my $modules_path = "/usr/lib/gosa-si/modules"; use lib "/usr/lib/gosa-si/modules"; -my $server_version = "$HeadURL$:$Rev$"; +my $server_version = '$HeadURL$:$Rev$'; +my $server_headURL; +my $server_revision; +my $server_status; + # TODO es gibt eine globale funktion get_ldap_handle # - ist in einer session dieses ldap handle schon vorhanden, wird es zurückgegeben @@ -2518,8 +2522,23 @@ if( 0 != $pid ) { }; } +# parse head url and revision from svn +my $server_status_hash = { 'developmental'=>'revision', 'stable'=>'release'}; +$server_version =~ /^\$HeadURL: (\S+) \$:\$Rev: (\d+) \$$/; +$server_headURL = defined $1 ? $1 : 'unknown' ; +$server_revision = defined $2 ? $2 : 'unknown' ; +if ($server_headURL =~ /\/tag\// || + $server_headURL =~ /\/branches\// ) { + $server_status = "stable"; +} else { + $server_status = "developmental" ; +} + + daemon_log(" ", 1); daemon_log("$0 started!", 1); +daemon_log("status: $server_status", 1); +daemon_log($server_status_hash->{$server_status}.": $server_revision", 1); if ($no_bus > 0) { $bus_activ = "false" diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index e81b1d533..aa040b874 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -5,7 +5,6 @@ use Exporter; # Each module has to have a function 'process_incoming_msg'. This function works as a interface to gosa-sd and receives the msg hash from gosa-sd. 'process_incoming_function checks, wether it has a function to process the incoming msg and forward the msg to it. - use strict; use warnings; use GOSA::GosaSupportDaemon; @@ -511,6 +510,8 @@ sub here_i_am { my $source = @{$msg_hash->{source}}[0]; my $mac_address = @{$msg_hash->{mac_address}}[0]; my $gotoHardwareChecksum = @{$msg_hash->{gotoHardwareChecksum}}[0]; + my $client_status = @{$msg_hash->{client_status}}[0]; + my $client_revision = @{$msg_hash->{client_revision}}[0]; # number of known clients my $nu_clients= $main::known_clients_db->count_dbentries('known_clients'); @@ -609,6 +610,9 @@ sub here_i_am { push(@out_msg_l, $hardware_config_out); } + &main::daemon_log("$session_id INFO: register client $source ($mac_address)", 5); + &main::daemon_log("$session_id INFO: client version: $client_status - $client_revision", 5); + return @out_msg_l; } -- 2.30.2