From: rettenbe Date: Mon, 25 Feb 2008 10:06:52 +0000 (+0000) Subject: new function for GOsa, trigger_action_faireboot X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=817e71f8f2b401ebfedd63e5f68cf14aadb5d6ea;p=gosa.git new function for GOsa, trigger_action_faireboot git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9101 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/client/events/gosaTriggered.pm b/gosa-si/client/events/gosaTriggered.pm index e12911547..1d70194a9 100644 --- a/gosa-si/client/events/gosaTriggered.pm +++ b/gosa-si/client/events/gosaTriggered.pm @@ -5,6 +5,7 @@ my @events = ( "get_events", "trigger_action_localboot", "trigger_action_halt", + "trigger_action_faireboot", "trigger_action_reboot", "trigger_action_memcheck", "trigger_action_reinstall", @@ -68,6 +69,13 @@ sub trigger_action_localboot { } +sub trigger_action_faireboot { + my ($msg, $msg_hash) = @_; + system("/usr/sbin/faireboot"); + return; +} + + sub trigger_action_reboot { my ($msg, $msg_hash) = @_; print STDERR "jetzt würde ich trigger_action_reboot ausführen\n"; diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index f23bd1172..bde1ce252 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -858,8 +858,6 @@ sub register_at_gosa_si_server { sub check_key_and_xml_validity { my ($crypted_msg, $module_key) = @_; -#print STDERR "crypted_msg:$crypted_msg\n"; -#print STDERR "modul_key:$module_key\n"; my $msg; my $msg_hash; @@ -1272,7 +1270,7 @@ my $server_check = $server_check_cfg->val( "server", "ip"); if( defined $server_check ) { unshift(@servers, $server_address); my $servers_string = join(", ", @servers); - daemon_log("found servers in configuration file: $servers_string", 5); + daemon_log("INFO: found servers in configuration file: $servers_string", 5); } else { my @tmp_servers; if ( !$server_domain) { @@ -1299,11 +1297,11 @@ if( defined $server_check ) { } } - foreach my $server (@tmp_servers) { - unshift(@servers, $server); - } - my $servers_string = join(", ", @servers); - daemon_log("found servers in DNS: $servers_string", 5); + foreach my $server (@tmp_servers) { + unshift(@servers, $server); + } + my $servers_string = join(", ", @servers); + daemon_log("INFO: found servers in DNS: $servers_string", 5); } diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index 219a2fde5..bcf0176da 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -25,6 +25,7 @@ use Crypt::Rijndael; use Digest::MD5 qw(md5 md5_hex md5_base64); use MIME::Base64; use XML::Simple; +use utf8; my $op_hash = { 'eq' => '=', diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index d243faf6b..100a75f8a 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -11,6 +11,7 @@ my @events = ( "new_key_for_client", "detect_hardware", "trigger_action_localboot", + "trigger_action_faireboot", "trigger_action_reboot", "trigger_action_halt", "trigger_action_update", @@ -138,6 +139,14 @@ sub set_activated_for_installation { } +sub trigger_action_faireboot { + my ($msg, $msg_hash) = @_; + $msg =~ s/
gosa_trigger_action_faireboot<\/header>/
trigger_action_faireboot<\/header>/; + my @out_msg_l = ($msg); + return @out_msg_l; +} + + sub trigger_action_localboot { my ($msg, $msg_hash) = @_; $msg =~ s/
gosa_trigger_action_localboot<\/header>/
trigger_action_localboot<\/header>/; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 75aeedbce..debee10d9 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -15,53 +15,66 @@ $sock->setEncryptionKey("secret-gosa-password"); if($sock->connected()){ /* Prepare a hunge bunch of data to be send */ -# add +# jobdb add #$data = "
gosa_network_completition
GOSAGOSAws-muc-2
"; #$data = "
job_sayHello
10.89.1.155:2008300:1B:77:04:8A:6C 20130102133900
"; #$data = "
job_ping
10.89.1.155:20083 10.89.1.155:2008100:01:6c:9d:b9:fa 20130102133900
"; -# delete +# jobdb delete #$data = "
gosa_delete_jobdb_entry
3
"; # smbhash #$data = "
gosa_gen_smb_hash
GOSAGOSAtester
"; # Reload ldap config -$data = "
gosa_trigger_reload_ldap_config
GOSA00:01:6c:9d:b9:fa
"; +#$data = "
gosa_trigger_reload_ldap_config
GOSA00:01:6c:9d:b9:fa
"; -# update +# jobdb update #$data = "
gosa_update_status_jobdb_entry
GOSAGOSA 00:01:6c:9d:b9:fa 23450101000000XXXXXXXXXXXXXXx
"; #$data = "
gosa_update_status_jobdb_entry
GOSAGOSA waiting processing update
"; -# query +# jobdb query #$data = "
gosa_query_jobdb
andgt0le5
"; #$data= "
gosa_query_jobdb
ping03
"; #$data= "
gosa_query_jobdb
ping05timestamp
"; #$data= "
gosa_query_jobdb
"; -# count +# jobdb count #$data = "
gosa_count_jobdb
"; -# clear +# jobdb clear #$data = "
gosa_clear_jobdb
"; # set gosa-si-client to 'activated' #$data = "
gosa_set_activated_for_installation
10.89.1.31:20083 127.0.0.1:20081
"; + +# trigger jobs at client #$data = "
gosa_detect_hardware
10.89.1.31:20083 10.89.1.31:20081
"; -#$data = "
gosa_reboot
10.89.1.31:20083 10.89.1.31:20081
"; -#$data = "
gosa_reinstall
10.89.1.31:20083 10.89.1.31:20081
"; -#$data = "
gosa_softupdate
10.89.1.31:20083 10.89.1.31:20081
"; -#$data = "
gosa_halt
10.89.1.31:20083 10.89.1.31:20081
"; #$data = "
gosa_new_key_for_client
00:01:6c:9d:b9:fa 10.89.1.31:20081
"; -#$data = "
gosa_new_key_for_client
00:0c:29:bd:7b:e7 10.89.1.31:20081
"; -#$data = "
gosa_new_key_for_client
10.89.1.12:1234 10.89.1.31:20081
"; -#$data = "
gosa_new_key_for_client
10.89.1.31:20083 10.89.1.31:20081
"; #$data = "
gosa_trigger_action_wake
00:01:6c:9d:b9:fa 10.89.1.31:20081
"; +$data = "
gosa_trigger_action_faireboot
00:01:6c:9d:b9:fa GOSA
"; +#$data = "
job_trigger_action_reinstall
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa 20130101000000
"; +#$data = "
gosa_ping
00:01:6c:9d:b9:fa GOSA
"; + + +# to test +# "trigger_reload_ldap_config", +# "network_completition", +# "trigger_action_localboot", +# "trigger_action_faireboot", +# "trigger_action_reboot", +# "trigger_action_halt", +# "trigger_action_update", +# "trigger_action_reinstall", +# "trigger_action_memcheck", +# "trigger_action_sysinfo", +# "trigger_action_instant_update", +# "trigger_action_rescan", +# "trigger_action_wake", + -#$data = "
job_trigger_action_reinstall
GOSA00:01:6c:9d:b9:fa00:01:6c:9d:b9:fa20130101000000
"; -#$data = "
job_trigger_action_reinstall
GOSA00:01:6c:9d:b9:fa00:01:6c:9d:b9:fa98760101000000
"; $sock->write($data);