summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2007-02-01 14:44:24 +0000
committeretienne2007-02-01 14:44:24 +0000
commit399cea5af494c91726d2f68c7f9e41ff27c48497 (patch)
tree85988fde2b78fe65aca109507b71444db5697b0f
parentef955c3c8f727aa7cef3a289d4a6eeaf81ba9f41 (diff)
downloadivylaunch-399cea5af494c91726d2f68c7f9e41ff27c48497.zip
ivylaunch-399cea5af494c91726d2f68c7f9e41ff27c48497.tar.gz
ivylaunch-399cea5af494c91726d2f68c7f9e41ff27c48497.tar.bz2
ivylaunch-399cea5af494c91726d2f68c7f9e41ff27c48497.tar.xz
modif du process d'execution des agents pour faire fonctionner ivycontrolpenelt en etch
-rw-r--r--FugueConfig.pm101
-rw-r--r--debian/changelog7
-rwxr-xr-xivylaunch2
3 files changed, 64 insertions, 46 deletions
diff --git a/FugueConfig.pm b/FugueConfig.pm
index 23d05e5..dfda1b0 100644
--- a/FugueConfig.pm
+++ b/FugueConfig.pm
@@ -99,6 +99,18 @@ sub launchAgent {
} # end launchAgent
+sub execAgentBackground {
+
+ my ($appname, $host, $command, $options, $bus) = @_;
+ $options .= " -b $bus" if $bus;
+ my $command_opt = $command;
+ $command_opt .= ' '.$options unless $options =~ /^\s*$/;
+ $command_opt = "$rsh -n $host '$command_opt'"
+ unless $host eq 'localhost' or $host eq hostname();
+ system("($command_opt 2>&1)&");
+
+} # end execAgentBackground
+
# launch a given command (not an ivy agent) on a given host
sub launchCommand {
@@ -114,51 +126,50 @@ sub launchCommand {
sub _launch {
- my ($label, $host, $command_opt, $type) = @_;
- my $pid = fork;
- warn ("[FugueConfig][WARNING] Could not fork $type \'$command_opt\'!\n"), return
- unless defined $pid;
-
- # parent P1
- if ($pid) {
- print "[FugueConfig][INFO] launch on $host $label $type \'$command_opt\' ".
- "(pid=$pid)\n";
- return ($pid);
-
- # child P2
- } else {
-
- # overload parent trap
- $SIG{INT} = 'DEFAULT';
-
- # remote command
- $command_opt = "$rsh -n $host '$command_opt'"
- unless $host eq 'localhost' or $host eq hostname();
-
- pipe(READER, WRITER);
- WRITER->autoflush(1);
- my $pid2 = fork;
- warn ("[FugueConfig][WARNING] Could not fork $type \'$command_opt\'!\n"),
- return
- unless defined $pid2;
- # parent P2
- if ($pid2) {
- close READER;
- CORE::open(STDOUT, ">&=WRITER") or
- die "[FugueConfig][WARNING] Couldn't redirect STDOUT";
- exec "$command_opt 2>&1 " or
- die "[FugueConfig][WARNING] Couldn't launch $command_opt";
- # child P3
- } else {
- close WRITER;
- while(<READER>) {
- chomp();
- print "$label $_\n";
- }
- close READER;
- exit;
- }
- }
+ my ($label, $host, $command_opt, $type) = @_;
+ my $pid = fork;
+ warn ("[FugueConfig][WARNING] Could not fork $type \'$command_opt\'!\n"), return
+ unless defined $pid;
+
+ # parent P1
+ if ($pid) {
+ print "[FugueConfig][INFO] launch on $host $label $type \'$command_opt\' ".
+ "(pid=$pid)\n";
+ return ($pid);
+
+ # child P2
+ } else {
+
+ # overload parent trap
+ $SIG{INT} = 'DEFAULT';
+
+ # remote command
+ $command_opt = "$rsh -n $host '$command_opt'"
+ unless $host eq 'localhost' or $host eq hostname();
+
+ pipe(READER, WRITER);
+ WRITER->autoflush(1);
+ my $pid2 = fork;
+ warn ("[FugueConfig][WARNING] Could not fork $type \'$command_opt\'!\n"),
+ return unless defined $pid2;
+ # parent P2
+ if ($pid2) {
+ close READER;
+ CORE::open(STDOUT, ">&=WRITER") or
+ die "[FugueConfig][WARNING] Couldn't redirect STDOUT";
+ exec "$command_opt 2>&1 " or
+ die "[FugueConfig][WARNING] Couldn't launch $command_opt";
+ # child P3
+ } else {
+ close WRITER;
+ while(<READER>) {
+ chomp();
+ print "$label $_\n";
+ }
+ close READER;
+ exit;
+ }
+ }
} # end _launch
diff --git a/debian/changelog b/debian/changelog
index 44d1d15..a73d454 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ivylaunch (1.6) unstable; urgency=low
+
+ * FugueConfig.pm : modification du process d'exécution des agents pour
+ faire fonctionner ivycontrolpanel en etch.
+
+ -- Daniel Etienne <etienne@cena.fr> Tue, 30 Jan 2007 10:07:52 +0100
+
ivylaunch (1.5-3) unstable; urgency=low
* Missing man page
diff --git a/ivylaunch b/ivylaunch
index f26f301..63c7aa4 100755
--- a/ivylaunch
+++ b/ivylaunch
@@ -29,7 +29,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-our $VERSION = 1.5;
+our $VERSION = 1.6;
BEGIN {