summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4673798)
raw | patch | inline | side by side (parent: 4673798)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 21 Jul 2008 13:42:43 +0000 (13:42 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 21 Jul 2008 13:42:43 +0000 (13:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11735 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-client | patch | blob | history |
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 8944c1a0aa276898643bd8e0cfac20838ec9f375..c3608750a3458e474bd86618ef628b7a7bdce57b 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
my $result="0.0.0.0";
if($server_ip =~ /^(\d\d?\d?\.){3}\d\d?\d?$/) {
- if($server_ip eq "127.0.0.1") {
- $result="127.0.0.1";
- } else {
+ # client should always have a 'valid' ip-address, which is available from other hosts too,
+ # 127.0.0.1 says nothing to foreign host
+ #if($server_ip eq "127.0.0.1") {
+ # $result="127.0.0.1";
+ #} else {
my $PROC_NET_ROUTE= ('/proc/net/route');
open(PROC_NET_ROUTE, "<$PROC_NET_ROUTE")
last;
}
}
- }
+ #}
} else {
daemon_log("get_local_ip_for_remote_ip was called with a non-ip parameter: $server_ip", 1);
}
}
+sub sig_handler {
+ my ($kernel, $signal) = @_[KERNEL, ARG0] ;
+ daemon_log("0 INFO got signal '$signal'", 1);
+ $kernel->sig_handled();
+ return;
+}
+
+
sub _start {
my ($kernel, $heap) = @_[KERNEL, HEAP];
$kernel->alias_set('client_session');
$global_kernel = $kernel; # this is used to throw events at each point of the skript
-
+
+ $kernel->sig(USR1 => "sig_handler");
+
# force a registration at a gosa-si-server
$kernel->yield('register_at_gosa_si_server');
@@ -1128,10 +1140,6 @@ daemon_log("INFO: start socket for incoming xml messages at port '$client_port'
# prepare variables
if( inet_aton($server_ip) ){ $server_ip = inet_ntoa(inet_aton($server_ip)); }
-############################################################
-# to change
-#if( $server_ip eq "127.0.1.1" ) { $server_ip = "127.0.0.1" }
-############################################################
if (defined $server_ip && defined $server_port) {
$server_address = $server_ip.":".$server_port;
}
inline_states => {
_start => \&_start,
_default => \&_default,
+ sig_handler => \&sig_handler,
register_at_gosa_si_server => \®ister_at_gosa_si_server,
# trigger periodical tasks