/etc/init.d/networking を再起動すると、以前の設定を使用して wpa_supplicant が実行されるようになるのはなぜですか?

/etc/init.d/networking を再起動すると、以前の設定を使用して wpa_supplicant が実行されるようになるのはなぜですか?

背景:

私はDebian Lennyを使用しており、WiFiインターフェースを2つ持っています。/etc/network/interfaces

iface wlan0 inet static
        address 10.0.0.1
        network 10.0.0.0
        netmask 255.255.255.0
        broadcast 10.0.0.255

auto wlan1
iface wlan1 inet static
        address 192.168.5.1
        network 192.168.5.1
        netmask 255.255.255.0
        broadcast 192.168.0.25

したがって、 についての兆候はありませんwpa_supplicant

/etc/wpa_supplicant.conf私は wpa_supplicant (v2.0) を手動で使用して、 (wlan0 の場合) および/etc/wpa_supplicant2.conf(wlan1 の場合) 経由で WLAN に接続します。

問題:

Wi-FiインターフェースがWLANに接続されている間、私は

ip link set wlan0 down
ip link set wlan1 up
rm /var/run/wpa_supplicant/wlan0
rm /var/run/wpa_supplicant/wlan1

次に、 を実行しますip link set wlan0 (and 1) up。その場合、iwconfig は、WiFi インターフェイスがどのネットワークにも接続されていないことを示します。

その後、 を実行します/etc/init.d/networking restart。プロセスが完了すると、iwconfig は、WiFi インターフェイスが以前接続されていた WLAN に接続されていることを示します。

質問:

以前使用したインターフェースの .config ファイル (wlan0 の場合は wpa_suppliant.conf、wlan1 の場合は wpa_supplicant2.conf) を使用して wpa_supplicant を実行するのはなぜでしょうか/etc/init.d/networking restart? この手順を何度も繰り返しましたが、そのたびに、WiFi インターフェースは .config ファイルで定義されている同じネットワークに接続されます。

私がしたこと:

1)このスクリプトは何らかの方法で wpa_supplicant を使用しているのではないかと疑いました/etc/init.d/networking。そこで、スクリプトを調べてみました。

     #!/bin/sh -e
    ### BEGIN INIT INFO
    # Provides:          networking
    # Required-Start:    mountkernfs ifupdown $local_fs
    # Required-Stop:     ifupdown $local_fs
    # Default-Start:     S
    # Default-Stop:      0 6
    # Short-Description: Raise network interfaces.
    ### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"

[ -x /sbin/ifup ] || exit 0

. /lib/lsb/init-functions

process_options() {
    [ -e /etc/network/options ] || return 0
    log_warning_msg "/etc/network/options still exists and it will be IGNORED! R
ead README.Debian of netbase."
}

check_network_file_systems() {
    [ -e /proc/mounts ] || return 0

    exec 9<&0 < /proc/mounts
    while read DEV MTPT FSTYPE REST; do
        case $DEV in
        /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
            log_warning_msg "not deconfiguring network interfaces: network devic
es still mounted."
            exit 0
            ;;
        esac
        case $FSTYPE in
        nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse
.curlftpfs)
            log_warning_msg "not deconfiguring network interfaces: network file 
systems still mounted."
            exit 0
            ;;
        esac
    done
    exec 0<&9 9<&-
}

case "$1" in
start)

        process_options

        log_action_begin_msg "Configuring network interfaces"
        if ifup -a; then
            log_action_end_msg $?
        else
            log_action_end_msg $?
        fi
        ;;

stop)
        check_network_file_systems

        log_action_begin_msg "Deconfiguring network interfaces"
        if ifdown -a --exclude=lo; then
            log_action_end_msg $?
        else
            log_action_end_msg $?
        fi
        ;;

force-reload|restart)
        process_options

        log_action_begin_msg "Reconfiguring network interfaces"
        ifdown -a --exclude=lo || true
        if ifup -a --exclude=lo; then
            log_action_end_msg $?
        else
            log_action_end_msg $?
        fi
        ;;

*)
        echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
        exit 1
        ;;
esac

exit 0

ifupdownは、ifdown が実行される前に wpa_supplicant を強制終了するスクリプトです (スクリプトで説明されているとおり)。私はシェルや bash プログラミングについては知りませんが、私が理解しているとおり、restart はインターフェイスの ifdown と ifup のみを実行します。

2)ifupのマニュアルページそれはこう言います:

ifup コマンドと ifdown コマンドは、/etc/network/interfaces ファイル内のインターフェース定義に基づいてネットワーク インターフェースを設定 (または設定解除) するために使用できます。

my には/etc/network/interfaceswpa_supplicant に関する設定は含まれていません。

関連情報