* [PATCH] warn when iproute2 or bridge-utils are missing
@ 2005-02-25 19:08 Scott Parish
2005-02-25 20:22 ` Matt Ayres
0 siblings, 1 reply; 4+ messages in thread
From: Scott Parish @ 2005-02-25 19:08 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
The attached patch checks for "ip" and "brctl" in the path, and warns
the user if they are not found.
sRp
--
Scott Parish
[-- Attachment #2: check_network_packages.patch --]
[-- Type: text/plain, Size: 1181 bytes --]
diff -rN -u xen-2.0.4-old/tools/misc/xend xen-2.0.4-new/tools/misc/xend
--- xen-2.0.4-old/tools/misc/xend 2005-02-04 13:38:37.000000000 +0000
+++ xen-2.0.4-new/tools/misc/xend 2005-02-25 19:00:55.000000000 +0000
@@ -89,12 +89,30 @@
msg("Xend must be run as root.")
hline()
raise CheckError("invalid user")
+
+def check_network_packages():
+ """Check that iproute2 and bridge-utils are installed.
+ """
+ def file_in_path(file):
+ return reduce(lambda a, b: a or b,
+ [os.path.isfile(os.path.join(dir, file)) for
+ dir in os.getenv("PATH").split(os.path.pathsep)], 0)
+ if not file_in_path("ip"):
+ hline()
+ msg("Warning: 'ip' not found in path: verify iproute2 is installed")
+ hline()
+ if not file_in_path("brctl"):
+ hline()
+ msg("Warning: 'brctl' not found in path: verify bridge-utils is installed")
+ hline()
+
def main():
try:
check_logging()
check_twisted_version()
check_user()
+ check_network_packages()
except CheckError:
sys.exit(1)
daemon = SrvDaemon.instance()
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] warn when iproute2 or bridge-utils are missing
2005-02-25 19:08 [PATCH] warn when iproute2 or bridge-utils are missing Scott Parish
@ 2005-02-25 20:22 ` Matt Ayres
2005-02-25 21:21 ` Scott Parish
0 siblings, 1 reply; 4+ messages in thread
From: Matt Ayres @ 2005-02-25 20:22 UTC (permalink / raw)
To: Scott Parish; +Cc: xen-devel
On Fri, 2005-02-25 at 19:08 +0000, Scott Parish wrote:
> The attached patch checks for "ip" and "brctl" in the path, and warns
> the user if they are not found.
>
Now that the routed setup is included (and IMHO works a whole lot
better) shouldn't the brctl check be optional somehow?
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] warn when iproute2 or bridge-utils are missing
2005-02-25 20:22 ` Matt Ayres
@ 2005-02-25 21:21 ` Scott Parish
2005-02-25 21:48 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Scott Parish @ 2005-02-25 21:21 UTC (permalink / raw)
To: Matt Ayres; +Cc: Scott Parish, xen-devel
On Fri, Feb 25, 2005 at 03:22:58PM -0500, Matt Ayres wrote:
> On Fri, 2005-02-25 at 19:08 +0000, Scott Parish wrote:
> > The attached patch checks for "ip" and "brctl" in the path, and warns
> > the user if they are not found.
> >
>
> Now that the routed setup is included (and IMHO works a whole lot
> better) shouldn't the brctl check be optional somehow?
Maybe what i started to do would be better then: make sure that output
from the scripts gets sent to the console in addition to getting buried
in the log file. Then have the scripts check that the programs that they
need are available (before fiddling with the network and putting it in a
half way state).
sRp
--
Scott Parish
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] warn when iproute2 or bridge-utils are missing
2005-02-25 21:21 ` Scott Parish
@ 2005-02-25 21:48 ` Anthony Liguori
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2005-02-25 21:48 UTC (permalink / raw)
To: Scott Parish; +Cc: Matt Ayres, xen-devel
Isn't it more appropriate to have these be install-time checks?
It seems wasteful to check for an installed program every time a script
is run. I submitted check scripts for iproute2 and iptables a while ago.
All you have to do is add a check_iproute2 script to the tools/check
directory that basically looks like:
#!/bin/sh
which ip || (echo "Check for iproute2 failed && exit 1)
Regards,
Anthony Liguori
Scott Parish wrote:
>On Fri, Feb 25, 2005 at 03:22:58PM -0500, Matt Ayres wrote:
>
>
>
>>On Fri, 2005-02-25 at 19:08 +0000, Scott Parish wrote:
>>
>>
>>>The attached patch checks for "ip" and "brctl" in the path, and warns
>>>the user if they are not found.
>>>
>>>
>>>
>>Now that the routed setup is included (and IMHO works a whole lot
>>better) shouldn't the brctl check be optional somehow?
>>
>>
>
>Maybe what i started to do would be better then: make sure that output
>from the scripts gets sent to the console in addition to getting buried
>in the log file. Then have the scripts check that the programs that they
>need are available (before fiddling with the network and putting it in a
>half way state).
>
>sRp
>
>
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-02-25 21:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-25 19:08 [PATCH] warn when iproute2 or bridge-utils are missing Scott Parish
2005-02-25 20:22 ` Matt Ayres
2005-02-25 21:21 ` Scott Parish
2005-02-25 21:48 ` Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.