Discussion:
ifdown
David Henderson
2011-06-16 17:25:15 UTC
Permalink
Hello everyone! I'm working some more with the 'if*' commands and come
across an issue and wanted to ask about it here. I have a script that
calls 'ifdown' for an adapter like: ifdown -f lan01 && echo success ||
echo failure. I noticed that it wasn't executing correctly so I
performed the step manually from the command line like:

# ifdown lan01 && echo success || echo failure
ifdown: interface lan01 not configured
success
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown', and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'. Currently I'm working around the issue by calling
'ifconfig lan01 down' which does work correctly. Any ideas as to what's
going on here? These are all busybox applets, btw.

Thanks,
Dave
David Henderson
2011-06-17 14:17:16 UTC
Permalink
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and
come across an issue and wanted to ask about it here. I have a script
that calls 'ifdown' for an adapter like: ifdown -f lan01 && echo
success || echo failure. I noticed that it wasn't executing correctly
# ifdown lan01 && echo success || echo failure
ifdown: interface lan01 not configured
success
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown', and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'. Currently I'm working around the issue by
calling 'ifconfig lan01 down' which does work correctly. Any ideas as
to what's going on here? These are all busybox applets, btw.
Thanks,
Dave
bump for help
Christopher Barry
2011-06-17 14:36:27 UTC
Permalink
Post by David Henderson
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and
come across an issue and wanted to ask about it here. I have a script
that calls 'ifdown' for an adapter like: ifdown -f lan01 && echo
success || echo failure. I noticed that it wasn't executing correctly
# ifdown lan01 && echo success || echo failure
ifdown: interface lan01 not configured
success
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown', and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'. Currently I'm working around the issue by
calling 'ifconfig lan01 down' which does work correctly. Any ideas as
to what's going on here? These are all busybox applets, btw.
Thanks,
Dave
bump for help
what happens if you temporarily rename the interface to a more standard
name, like eth0 (use nameif to do this), and see if it's the name lan01
causing you problems. That would help nail it down.

-C
David Henderson
2011-06-17 15:54:07 UTC
Permalink
Post by Christopher Barry
Post by David Henderson
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and
come across an issue and wanted to ask about it here. I have a script
that calls 'ifdown' for an adapter like: ifdown -f lan01&& echo
success || echo failure. I noticed that it wasn't executing correctly
# ifdown lan01&& echo success || echo failure
ifdown: interface lan01 not configured
success
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown', and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'. Currently I'm working around the issue by
calling 'ifconfig lan01 down' which does work correctly. Any ideas as
to what's going on here? These are all busybox applets, btw.
Thanks,
Dave
bump for help
what happens if you temporarily rename the interface to a more standard
name, like eth0 (use nameif to do this), and see if it's the name lan01
causing you problems. That would help nail it down.
-C
I don't recall any issues when using the eth0 naming scheme, but unless
the network adapter isn't being renamed somewhere by the ifrename binary
(or there's a bug in busyboxes ifdown), then I can't understand why just
naming the adapter lan01 would be the cause of the problem. That's not
a special name used in anything that I'm aware of. :) Also, it further
complicates the situation because ifconfig doesn't have any issues bring
down the interface, just ifdown. Any other thoughts?

Dave
Christopher Barry
2011-06-17 17:29:24 UTC
Permalink
Post by David Henderson
Post by Christopher Barry
Post by David Henderson
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and
come across an issue and wanted to ask about it here. I have a script
that calls 'ifdown' for an adapter like: ifdown -f lan01&& echo
success || echo failure. I noticed that it wasn't executing correctly
# ifdown lan01&& echo success || echo failure
ifdown: interface lan01 not configured
success
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown', and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'. Currently I'm working around the issue by
calling 'ifconfig lan01 down' which does work correctly. Any ideas as
to what's going on here? These are all busybox applets, btw.
Thanks,
Dave
bump for help
what happens if you temporarily rename the interface to a more standard
name, like eth0 (use nameif to do this), and see if it's the name lan01
causing you problems. That would help nail it down.
-C
I don't recall any issues when using the eth0 naming scheme, but unless
the network adapter isn't being renamed somewhere by the ifrename binary
(or there's a bug in busyboxes ifdown), then I can't understand why just
naming the adapter lan01 would be the cause of the problem. That's not
a special name used in anything that I'm aware of. :) Also, it further
complicates the situation because ifconfig doesn't have any issues bring
down the interface, just ifdown. Any other thoughts?
Dave
My thinking was that it may be a name parsing error in ifdown. If it
behaves correctly while named eth0, then that would help to isolate the
problem. Also, what type of interface is named lan01 by default?

Good Luck,
-C
David Henderson
2011-06-17 19:52:29 UTC
Permalink
Post by Christopher Barry
Post by David Henderson
Post by Christopher Barry
Post by David Henderson
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and
come across an issue and wanted to ask about it here. I have a script
that calls 'ifdown' for an adapter like: ifdown -f lan01&& echo
success || echo failure. I noticed that it wasn't executing correctly
# ifdown lan01&& echo success || echo failure
ifdown: interface lan01 not configured
success
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown', and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'. Currently I'm working around the issue by
calling 'ifconfig lan01 down' which does work correctly. Any ideas as
to what's going on here? These are all busybox applets, btw.
Thanks,
Dave
bump for help
what happens if you temporarily rename the interface to a more standard
name, like eth0 (use nameif to do this), and see if it's the name lan01
causing you problems. That would help nail it down.
-C
I don't recall any issues when using the eth0 naming scheme, but unless
the network adapter isn't being renamed somewhere by the ifrename binary
(or there's a bug in busyboxes ifdown), then I can't understand why just
naming the adapter lan01 would be the cause of the problem. That's not
a special name used in anything that I'm aware of. :) Also, it further
complicates the situation because ifconfig doesn't have any issues bring
down the interface, just ifdown. Any other thoughts?
Dave
My thinking was that it may be a name parsing error in ifdown. If it
behaves correctly while named eth0, then that would help to isolate the
problem. Also, what type of interface is named lan01 by default?
Good Luck,
-C
Thanks for the continued help Christopher. By default the interface
comes up as eth0, but for several reasons, the adapter was renamed using
lan## as the static naming convention. Does it look like we have
isolated it to an ifdown binary issue at this point? I can't think it
could be anything else as all other software seems to work fine (e.g.
ifup, ifconfig, ifrename, etc).

Dave
Denys Vlasenko
2011-06-18 08:50:01 UTC
Permalink
Post by David Henderson
Post by Christopher Barry
what happens if you temporarily rename the interface to a more standard
name, like eth0 (use nameif to do this), and see if it's the name lan01
causing you problems. That would help nail it down.
-C
I don't recall any issues when using the eth0 naming scheme, but unless
the network adapter isn't being renamed somewhere by the ifrename binary
(or there's a bug in busyboxes ifdown), then I can't understand why just
naming the adapter lan01 would be the cause of the problem. That's not
a special name used in anything that I'm aware of. :)
Yes, ethN must not be special in any way (except that eth0 is a default name
for many networking tools, but all such tools have an option to specify
iface by hand).
Post by David Henderson
Also, it further
complicates the situation because ifconfig doesn't have any issues bring
down the interface, just ifdown. Any other thoughts?
I have some:

http://busybox.net/~vda/no_ifup.txt
--
vda
Denys Vlasenko
2011-06-18 08:48:09 UTC
Permalink
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and come
across an issue and wanted to ask about it here. I have a script that
calls 'ifdown' for an adapter like: ifdown -f lan01 && echo success ||
echo failure. I noticed that it wasn't executing correctly so I
# ifdown lan01 && echo success || echo failure
ifdown: interface lan01 not configured
success
"ifdown lan01; echo $?" would be more informative here
Post by David Henderson
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown'
ifdown checks iface state by looking into /var/run/ifstate.
If you configured iface, say, by hand, ifdown will see nothing there
and will think that "interface lan01 not configured".

Whta is in your /var/run/ifstate and /etc/network/interfaces files?
Post by David Henderson
and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'.
This is a bug _if_ standard ifdown does report failure in this case.
Can you test standard tool behavior?
--
vda
David Henderson
2011-06-22 15:29:52 UTC
Permalink
Post by Denys Vlasenko
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and come
across an issue and wanted to ask about it here. I have a script that
calls 'ifdown' for an adapter like: ifdown -f lan01&& echo success ||
echo failure. I noticed that it wasn't executing correctly so I
# ifdown lan01&& echo success || echo failure
ifdown: interface lan01 not configured
success
"ifdown lan01; echo $?" would be more informative here
Post by David Henderson
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown'
ifdown checks iface state by looking into /var/run/ifstate.
If you configured iface, say, by hand, ifdown will see nothing there
and will think that "interface lan01 not configured".
Whta is in your /var/run/ifstate and /etc/network/interfaces files?
Post by David Henderson
and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'.
This is a bug _if_ standard ifdown does report failure in this case.
Can you test standard tool behavior?
Thanks for the reply Denys. I think I see where the problem lies - I
don't have a /var/run/ifstate file! What binary creates this file? I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries. Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. Thoughts?

Thanks,
Dave
Christopher Barry
2011-06-22 18:30:28 UTC
Permalink
Post by David Henderson
Thanks for the reply Denys. I think I see where the problem lies - I
don't have a /var/run/ifstate file! What binary creates this file? I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries. Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. Thoughts?
Thanks,
Dave
grep -r ifstate /etc/*

shows several scripts touching it. it will depend on your setup though
what files you have that are touching it.

-C
David Henderson
2011-06-22 21:12:44 UTC
Permalink
Post by Christopher Barry
Post by David Henderson
Thanks for the reply Denys. I think I see where the problem lies - I
don't have a /var/run/ifstate file! What binary creates this file? I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries. Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. Thoughts?
Thanks,
Dave
grep -r ifstate /etc/*
shows several scripts touching it. it will depend on your setup though
what files you have that are touching it.
-C
I didn't even know about that file, so I can assure you that it's not
being touched, modified, or created by any of the scripts to the OS.
Just as a precaution, I performed the command above with no results. It
looks like I'll just have to use the ifconfig command instead of
ifdown. Thanks for the suggestion though. :)

Dave
Denys Vlasenko
2011-06-22 20:01:30 UTC
Permalink
Post by David Henderson
Post by Denys Vlasenko
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and come
across an issue and wanted to ask about it here. I have a script that
calls 'ifdown' for an adapter like: ifdown -f lan01&& echo success ||
echo failure. I noticed that it wasn't executing correctly so I
# ifdown lan01&& echo success || echo failure
ifdown: interface lan01 not configured
success
"ifdown lan01; echo $?" would be more informative here
Post by David Henderson
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown'
ifdown checks iface state by looking into /var/run/ifstate.
If you configured iface, say, by hand, ifdown will see nothing there
and will think that "interface lan01 not configured".
Whta is in your /var/run/ifstate and /etc/network/interfaces files?
Post by David Henderson
and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'.
This is a bug _if_ standard ifdown does report failure in this case.
Can you test standard tool behavior?
Thanks for the reply Denys. I think I see where the problem lies - I
don't have a /var/run/ifstate file! What binary creates this file?
ifup and ifdown. (Although on some systmes they aren't binaries,
they are scripts).
Post by David Henderson
I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries.
If you dont use ifup to up the iface, why do you use ifdown
to deconfigure it?
Post by David Henderson
Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. Thoughts?
You seem to be confused. /etc/network/interfaces should be edited by
admin, not created by scripts.
--
vda
David Henderson
2011-06-22 21:10:40 UTC
Permalink
Post by Denys Vlasenko
Post by David Henderson
Post by Denys Vlasenko
Post by David Henderson
Hello everyone! I'm working some more with the 'if*' commands and come
across an issue and wanted to ask about it here. I have a script that
calls 'ifdown' for an adapter like: ifdown -f lan01&& echo success ||
echo failure. I noticed that it wasn't executing correctly so I
# ifdown lan01&& echo success || echo failure
ifdown: interface lan01 not configured
success
"ifdown lan01; echo $?" would be more informative here
Post by David Henderson
# ifconfig
lan01 Link encap:Ethernet HWaddr 00:27:0E:17:99:35
inet addr:192.168.0.198 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:34257 (33.4 KiB) TX bytes:15911 (15.5 KiB)
Memory:d0d00000-d0d20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I see two issues right off the top. First, as you can see, the lan01
interface does exist but isn't seen by 'ifdown'
ifdown checks iface state by looking into /var/run/ifstate.
If you configured iface, say, by hand, ifdown will see nothing there
and will think that "interface lan01 not configured".
Whta is in your /var/run/ifstate and /etc/network/interfaces files?
Post by David Henderson
and second, it's exit
status doesn't appear to be correct as it should have shown 'failure'
instead of 'success'.
This is a bug _if_ standard ifdown does report failure in this case.
Can you test standard tool behavior?
Thanks for the reply Denys. I think I see where the problem lies - I
don't have a /var/run/ifstate file! What binary creates this file?
ifup and ifdown. (Although on some systmes they aren't binaries,
they are scripts).
I'm assuming that since I don't call ifup, that might be why the file
isn't being created... Perhaps this could be created manually so ifdown
can work?
Post by Denys Vlasenko
Post by David Henderson
I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries.
If you dont use ifup to up the iface, why do you use ifdown
to deconfigure it?
Because the script takes into account disconnected interfaces and
assigns a 169.254.x.x address, thus a call to ifdown. With the problems
experienced with the ifdown binary, a temporary (or permanent) work
around is to use the ifconfig binary (which has no problems).
Post by Denys Vlasenko
Post by David Henderson
Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. Thoughts?
You seem to be confused. /etc/network/interfaces should be edited by
admin, not created by scripts.
Nope, no confusion. /etc/network/interfaces is created dynamically by
scripts which has actually produced less headache if NIC's are switched
or configuration changes need to occur. Sure beats the "by hand" way of
doing it! :)

I guess at this point, we've realized that this doesn't appear to really
be a bug since it's just a matter of a missing file. And since none of
the scripts call if the ifup command (which I guess is what creates the
/var/run/ifstate file), I'll just have to continue to use the ifconfig
work around. Thanks for everyone's help!

Dave
Denys Vlasenko
2011-06-23 13:04:10 UTC
Permalink
On Wed, Jun 22, 2011 at 11:10 PM, David Henderson
Post by Denys Vlasenko
Post by David Henderson
I think I see where the problem lies - I
don't have a /var/run/ifstate file! ?What binary creates this file?
ifup and ifdown. (Although on some systmes they aren't binaries,
they are scripts).
I'm assuming that since I don't call ifup, that might be why the file isn't
being created... ?Perhaps this could be created manually so ifdown can work?
Post by Denys Vlasenko
Post by David Henderson
I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries.
If you dont use ifup to up the iface, why do you use ifdown
to deconfigure it?
Because the script takes into account disconnected interfaces and assigns a
169.254.x.x address, thus a call to ifdown. ?With the problems experienced
with the ifdown binary, a temporary (or permanent) work around is to use the
ifconfig binary (which has no problems).
Post by Denys Vlasenko
Post by David Henderson
Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. ?Thoughts?
You seem to be confused. /etc/network/interfaces should be edited by
admin, not created by scripts.
Nope, no confusion. ?/etc/network/interfaces is created dynamically by
scripts which has actually produced less headache if NIC's are switched or
configuration changes need to occur. ?Sure beats the "by hand" way of doing
it! :)
You are trying to use ifup/ifdown in a wrong way.

Every tool has some design idea behind it, "how it supposed to be used".

ifup/ifdown tools are built with the assumption that user expesses his network
configuration in /etc/network/interfaces (such as "this iface is
static, this iface
is DHCP, ...") and then uses exclusively ifup/ifdown to up/down interfaces.
And ifup and ifdown will call necessary other lower-level programs to do
the requested operation - not the user.

Not that I like this design idea (I don't - it's doesn't cover a lot
of real-world
situations), but that's how ifup/ifdown are designed. If you really want to use
these tools, you are better to conform to their design.

Trying to use ifdown without ifup totally undermines it.
--
vda
David Henderson
2011-06-23 14:47:26 UTC
Permalink
Post by Denys Vlasenko
On Wed, Jun 22, 2011 at 11:10 PM, David Henderson
Post by Denys Vlasenko
Post by David Henderson
I think I see where the problem lies - I
don't have a /var/run/ifstate file! What binary creates this file?
ifup and ifdown. (Although on some systmes they aren't binaries,
they are scripts).
I'm assuming that since I don't call ifup, that might be why the file isn't
being created... Perhaps this could be created manually so ifdown can work?
Post by Denys Vlasenko
Post by David Henderson
I'm
not configuring the iface by hand, but with utilities such as ifplugd,
udhcp, and if* binaries.
If you dont use ifup to up the iface, why do you use ifdown
to deconfigure it?
Because the script takes into account disconnected interfaces and assigns a
169.254.x.x address, thus a call to ifdown. With the problems experienced
with the ifdown binary, a temporary (or permanent) work around is to use the
ifconfig binary (which has no problems).
Post by Denys Vlasenko
Post by David Henderson
Also, the /etc/network/interfaces file does
get created in a script, but matches all the naming conventions and
works just fine. Thoughts?
You seem to be confused. /etc/network/interfaces should be edited by
admin, not created by scripts.
Nope, no confusion. /etc/network/interfaces is created dynamically by
scripts which has actually produced less headache if NIC's are switched or
configuration changes need to occur. Sure beats the "by hand" way of doing
it! :)
You are trying to use ifup/ifdown in a wrong way.
Every tool has some design idea behind it, "how it supposed to be used".
ifup/ifdown tools are built with the assumption that user expesses his network
configuration in /etc/network/interfaces (such as "this iface is
static, this iface
is DHCP, ...") and then uses exclusively ifup/ifdown to up/down interfaces.
And ifup and ifdown will call necessary other lower-level programs to do
the requested operation - not the user.
Not that I like this design idea (I don't - it's doesn't cover a lot
of real-world
situations), but that's how ifup/ifdown are designed. If you really want to use
these tools, you are better to conform to their design.
Trying to use ifdown without ifup totally undermines it.
Thanks for the tips Denys. Apparently you really can't use one without
the other (which I was trying to do). :) As stated, I created a
temporary work around using "ifconfig ... down" which is working without
problems so I'll just make it a permanent change. Thanks for your help
and efforts in this matter.

Dave

Continue reading on narkive:
Loading...