1 |
darkside 10/05/09 22:06:27 |
2 |
|
3 |
Added: 0002-Add-ipv6-monitor-support-to-mirmon.patch |
4 |
0001-Add-rsync-monitoring-support-to-mirmon.patch |
5 |
Log: |
6 |
Move from net-analyzer/mirmon. Don't install empty directories and install mirmon script in HOSTROOT instead of HTDOCS |
7 |
(Portage version: 2.1.8.3/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 www-apps/mirmon/files/0002-Add-ipv6-monitor-support-to-mirmon.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/mirmon/files/0002-Add-ipv6-monitor-support-to-mirmon.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/mirmon/files/0002-Add-ipv6-monitor-support-to-mirmon.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: 0002-Add-ipv6-monitor-support-to-mirmon.patch |
16 |
=================================================================== |
17 |
https://bugs.gentoo.org/show_bug.cgi?id=289943 |
18 |
|
19 |
From ab302148275a973c3fccd164fa1ae4b4c4409d21 Mon Sep 17 00:00:00 2001 |
20 |
From: Jeremy Olexa <darkside@g.o> |
21 |
Date: Wed, 28 Oct 2009 21:04:39 -0500 |
22 |
Subject: [PATCH 2/2] Add ipv6 monitor support to mirmon |
23 |
|
24 |
This patch will overload the gethost() function provided by perl in such a way |
25 |
that it uses gethostbyname2() from Socket6, which is a new dependency. |
26 |
|
27 |
Original patch by: Kent Fredric |
28 |
--- |
29 |
mirmon | 12 +++++++++++- |
30 |
1 files changed, 11 insertions(+), 1 deletions(-) |
31 |
|
32 |
diff --git a/mirmon b/mirmon |
33 |
index 6c0aaa8..50d40ca 100755 |
34 |
--- a/mirmon |
35 |
+++ b/mirmon |
36 |
@@ -30,7 +30,17 @@ my $VER = '$Id: 0002-Add-ipv6-monitor-support-to-mirmon.patch,v 1.1 2010/05/09 22:06:26 darkside Exp $' ; |
37 |
use strict ; |
38 |
use IO::Pipe ; |
39 |
use IO::Select ; |
40 |
-use Net::hostent ; |
41 |
+ |
42 |
+use Socket; |
43 |
+use Socket6; |
44 |
+use Data::Dumper qw( Dumper ); |
45 |
+ |
46 |
+sub gethost($){ |
47 |
+ my $url = shift; |
48 |
+ return 1 if gethostbyname2 $url, AF_INET; |
49 |
+ return 1 if gethostbyname2 $url, AF_INET6; |
50 |
+ return 0; |
51 |
+} |
52 |
|
53 |
my $DEF_CNF = "/etc/$PRG.conf" ; |
54 |
|
55 |
-- |
56 |
1.6.4.4 |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
1.1 www-apps/mirmon/files/0001-Add-rsync-monitoring-support-to-mirmon.patch |
62 |
|
63 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/mirmon/files/0001-Add-rsync-monitoring-support-to-mirmon.patch?rev=1.1&view=markup |
64 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-apps/mirmon/files/0001-Add-rsync-monitoring-support-to-mirmon.patch?rev=1.1&content-type=text/plain |
65 |
|
66 |
Index: 0001-Add-rsync-monitoring-support-to-mirmon.patch |
67 |
=================================================================== |
68 |
https://bugs.gentoo.org/show_bug.cgi?id=289942 |
69 |
|
70 |
From d91f1f17be33dfc5ed771829639791b5463417a2 Mon Sep 17 00:00:00 2001 |
71 |
From: Jeremy Olexa <darkside@g.o> |
72 |
Date: Wed, 28 Oct 2009 20:58:45 -0500 |
73 |
Subject: [PATCH 1/2] Add rsync monitoring support to mirmon. |
74 |
|
75 |
You will also need to modify mirmon.conf to use probe-mirmon instead |
76 |
Original patch located at: http://www.tug.org/texlive/mirmon/probe-mirmon |
77 |
--- |
78 |
mirmon | 2 +- |
79 |
probe-mirmon | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ |
80 |
2 files changed, 51 insertions(+), 1 deletions(-) |
81 |
create mode 100644 probe-mirmon |
82 |
|
83 |
diff --git a/mirmon b/mirmon |
84 |
index a1261f5..6c0aaa8 100755 |
85 |
--- a/mirmon |
86 |
+++ b/mirmon |
87 |
@@ -384,7 +384,7 @@ sub get_ccs |
88 |
sub type_site |
89 |
{ my $url = shift ; |
90 |
my ( $type, $site, $home ) ; |
91 |
- if ( $url =~ m!^(ftp|http)://([^/:]+)(:\d+)?/! ) |
92 |
+ if ( $url =~ m!^(ftp|https?|rsync)://([^/:]+)(:\d+)?/! ) |
93 |
{ $type = $1 ; $site = $2 ; $home = $& ; } |
94 |
return $type, $site, $home ; |
95 |
} |
96 |
diff --git a/probe-mirmon b/probe-mirmon |
97 |
new file mode 100644 |
98 |
index 0000000..a7fe513 |
99 |
--- /dev/null |
100 |
+++ b/probe-mirmon |
101 |
@@ -0,0 +1,50 @@ |
102 |
+#!/usr/bin/env perl |
103 |
+# $Id: 0001-Add-rsync-monitoring-support-to-mirmon.patch,v 1.1 2010/05/09 22:06:26 darkside Exp $ |
104 |
+# public domain. Originally written by Karl Berry, 2009. |
105 |
+# |
106 |
+# Probe rsync url's for mirmon; use wget for anything else. |
107 |
+# From description at http://people.cs.uu.nl/henkp/mirmon. |
108 |
+# |
109 |
+# Also requires a patch to mirmon itself to accept rsync urls |
110 |
+# (and I wanted https too): |
111 |
+# --- /usr/local/share/mirmon/ORIG/mirmon 2007-08-18 18:05:47.000000000 +0200 |
112 |
+# +++ /usr/local/share/mirmon/mirmon 2009-07-03 22:38:00.000000000 +0200 |
113 |
+# @@ -386,3 +386,3 @@ |
114 |
+# my ( $type, $site, $home ) ; |
115 |
+# - if ( $url =~ m!^(ftp|http)://([^/:]+)(:\d+)?/! ) |
116 |
+# + if ( $url =~ m!^(ftp|https?|rsync)://([^/:]+)(:\d+)?/! ) |
117 |
+# { $type = $1 ; $site = $2 ; $home = $& ; } |
118 |
+ |
119 |
+exit (&main ()); |
120 |
+ |
121 |
+sub main |
122 |
+{ |
123 |
+ my ($timeout,$url) = @ARGV; |
124 |
+ my $ret; |
125 |
+ |
126 |
+ if ($url =~ m,^rsync://,) { |
127 |
+ $ret = &handle_rsync ($timeout, $url); |
128 |
+ } else { |
129 |
+ $ret = system qq(wget -q -O - -t 1 -T $timeout $url); |
130 |
+ } |
131 |
+ return $ret; |
132 |
+} |
133 |
+ |
134 |
+ |
135 |
+sub handle_rsync |
136 |
+{ |
137 |
+ my ($timeout,$url) = @_; |
138 |
+ |
139 |
+ my $tmpdir = "rsync-tmp"; |
140 |
+ -d $tmpdir || mkdir ($tmpdir, 0700); |
141 |
+ |
142 |
+ (my $file = $url) =~ s/\W/_/g; # translate all non-letters to _ |
143 |
+ my $local = "$tmpdir/$file"; |
144 |
+ my $ret = system |
145 |
+ qq(/usr/local/bin/rsync --no-motd --timeout $timeout $url $local); |
146 |
+ |
147 |
+ @ARGV = ($local); # don't care about our args any more. |
148 |
+ print <>; # let perl autoprint |
149 |
+ |
150 |
+ return $ret; |
151 |
+} |
152 |
-- |
153 |
1.6.4.4 |