From ac58fe426798954bc464989afc9c55a7658ac92c Mon Sep 17 00:00:00 2001 From: rettenbe Date: Fri, 22 Feb 2008 12:58:15 +0000 Subject: [PATCH] better daemon_log git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9072 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 9e18182a2..5dd01c3d7 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -201,6 +201,15 @@ sub check_pid { } +sub sig_int_handler { + my ($signal) = @_; + + daemon_log("shutting down gosa-si-server", 1); + exit(1); +} +$SIG{INT} = \&sig_int_handler; + + #=== FUNCTION ================================================================ # NAME: logging # PARAMETERS: level - string - default 'info' @@ -1391,9 +1400,15 @@ if( defined $server_check ) { else { if ( !$server_domain) { daemon_log("ERROR: please specify a gosa-si-server address or a domain in config file", 1); - exit( 1 ); + kill 2, $$; } my @tmp_servers = &get_server_addresses($server_domain); + if( 0 == @tmp_servers ) { + daemon_log("ERROR: no gosa-si-server found in DNS for domain '$server_domain'",1); + daemon_log("ERROR: please specify a gosa-si-server address or a domain in config file", 1); + kill 2, $$; + } + foreach my $server (@tmp_servers) { unshift(@servers, $server); } -- 2.30.2