On Mar 30, 2012, at 9:05 AM, Bruce Dubbs wrote:
> xinglp wrote:
>> http://www.linuxfromscratch.org/lfs/view/development/scripts/apds27.html
>>
>> if [ "$(ip addr show ${IFACE} | grep 'inet ')" != "" ]; then
>> log_info_msg "Bringing down the ${IFACE} interface..."
>> ip link set ${IFACE} down
>> evaluate_retval
>> fi
>>
>> should be
>>
>> if [ "$(ip addr show ${IFACE} | grep 'inet ')" == "" ]; then
>> log_info_msg "Bringing down the ${IFACE} interface..."
>> ip link set ${IFACE} down
>> evaluate_retval
>> fi
>
> I'm missing something here. Why would we need to set an interface down
> if the inet line is null?
Long story short--
Yes, the interface should go down in a clean shutdown. The question isn't
whether or not we want to take an interface down. The question is how we want
it to work when we want to--because we do when we execute /sbin/ifdown.
The service should remove the IP address (which it down)--and more to the
point--it should also be the one to check if it's been successfully removed.
ifdown should *not* do the IP config check. If the removal of the service
configuration fails, then the service itself should report an error; i.e., we
need someone to intervene.
The only case I'm not sure about is the case of having virtual interfaces
(though, after a quick look, I don't think it's a problem).
Q
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page