Code

bugfix: trigger_goto_settings_reload catches error case
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Sep 2008 11:55:07 +0000 (11:55 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 24 Sep 2008 11:55:07 +0000 (11:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12543 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/client/events/gosaTriggered.pm
gosa-si/tests/client.php

index fd954cab135f12df93dc320670424189d6ab8ad4..71da3267a4ba50a0ef7efb1dc33b5dd33170a89b 100644 (file)
@@ -500,8 +500,14 @@ sub trigger_goto_settings_reload {
     my ($msg, $msg_hash) = @_;
 
     # Execute goto settings reload
-    system("/etc/init.d/goto-configure start");
-    
+    my $cmd = "/etc/init.d/goto-configure";
+    my $pram = "start";
+    if (-f $cmd){
+        my $feedback = system("$cmd $pram") or &main::daemon_log("ERROR: $@");
+    } else {
+        &main::daemon_log("ERROR: cannot exec $cmd, file not found!");
+    }
+
     return;
 }
 
index 15fe8451362e6a48785b6d04d1ac2773a107cf96..450a377f5cb340dbc9a191a8604140520793bf1d 100755 (executable)
@@ -59,6 +59,7 @@ for($count = 1; $count <= $zahl; $count++)
 
 
     # trigger jobs at client
+    $data = "<xml> <header>gosa_trigger_goto_settings_reload</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>gosa_detect_hardware</header> <target>10.89.1.31:20083</target> <source>GOSA</source> </xml>";
     #$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:01:6c:9d:b9:fa</target> <source>10.89.1.31:20081</source> </xml>";
     #$data = "<xml> <header>job_trigger_action_wake</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <timestamp>19700101000000</timestamp></xml>";
@@ -185,7 +186,7 @@ for($count = 1; $count <= $zahl; $count++)
 
     # Querying the mailqueue at 
     #$data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> </xml>";
-    $data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <q_tag>recipient</q_tag> <q_operator>eq</q_operator> <q_value>retta</q_value> </xml>";
+    #$data = "<xml> <header>gosa_mailqueue_query</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <q_tag>recipient</q_tag> <q_operator>eq</q_operator> <q_value>retta</q_value> </xml>";
 
     # Multiple xml tags msg_id are allowed
     #$data = "<xml> <header>gosa_mailqueue_hold</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <msg_id>99C8ABEF23</msg_id> </xml>";