我在我的 debian Linux 系统上收到一条新的 systemd 日志消息。如下:
Nov 30 20:41:42 beaglebone sh[628]: autoconfigure_usb0.sh: g_multi: waiting for /sys/class/net/usb0/
此消息每隔几秒钟重复一次,我不确定是什么原因造成的。我在网上找不到关于此消息的信息。似乎某些服务已经运行了该autoconfigure_usb0.sh
脚本,但它显然不起作用。和网络接口有关系。我目前已连接到可访问互联网的正常运行的 wifi。该autoconfigure_usb0.sh
脚本如下所示:
debian@beaglebone:~$ cat /usr/bin/autoconfigure_usb0.sh
#!/bin/bash
#
# Copyright (c) 2017 David Lechner <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
if [ -f /etc/default/bb-boot ] ; then
. /etc/default/bb-boot
fi
#Backup...
if [ "x${USB_CONFIGURATION}" = "x" ] ; then
USB0_ADDRESS=192.168.7.2
USB0_NETMASK=255.255.255.252
fi
#
# Auto-configuring the usb1 network interface:
#
# usb1 is the CDC/ECM gadget connection. It is managed by ConnMan and uses
# tethering so that it serves a DHCP address to attached hosts. The IPv4 subnet
# used by ConnMan is not consistent, so hosts should connect using the mDNS
# name (beaglebone.local) instead of an IP address.
#
until [ -d /sys/class/net/usb0/ ] ; do
sleep 1
echo "autoconfigure_usb0.sh: g_multi: waiting for /sys/class/net/usb0/"
done
# gadget is not supported by ConnMan provisioning files, so we have to do this
# the ugly way. Advanced users can comment these line to gain full control of
# the usb1 network interface.
#connmanctl enable gadget >/dev/null 2>&1
#connmanctl tether gadget on >/dev/null 2>&1
# if there is any pre-existing config for usb1, use that;
# otherwise use a static default
grep -rqE '^\s*iface usb0 inet' /etc/network/interfaces* && /sbin/ifup usb0 \
|| /sbin/ifconfig usb0 ${USB0_ADDRESS} netmask ${USB0_NETMASK} \
|| true
我希望在这方面有更多经验的人可以帮助我弄清楚这里到底发生了什么。谢谢!
编辑:下面列出了以下命令的输出:
debian@beaglebone:~$ ls /sys/class/net
can0 can1 lo SoftAp0 wlan0