求助:为什么原来正常的XX-NET自启动不正常了?
发表于 : 2019-01-22 21:28
Ubuntu 18.04 LTS,此前配置了XX-NET脚本自启动如下,一直工作正常。
不知是否因为最近装了一堆各种各样的Docker及container,
现在变成每次开机后的xx_net.sh跟没有运行过一样,127.0.0.1:8085的访问时提示“This site can’t be reached”,只得重新手动再执行一遍这行命令方可。miredo倒是不需要重新执行。
开机后未运行任何命令时的网络配置如下:
代码: 全选
xxxx:~$ ls -l /etc/systemd/system/rc-local.service
lrwxrwxrwx 1 root root 36 Sep 13 22:31 /etc/systemd/system/rc-local.service -> /lib/systemd/system/rc-local.service
xxxx:~$ cat /etc/systemd/system/rc-local.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
Alias=rc-local.service
xxxx:~$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 59 Sep 13 22:31 /etc/rc.local
xxxx:~$ cat /etc/rc.local
#!/bin/bash
sudo /opt/xxnet/xx_net.sh start
sudo miredo
现在变成每次开机后的xx_net.sh跟没有运行过一样,127.0.0.1:8085的访问时提示“This site can’t be reached”,只得重新手动再执行一遍这行命令方可。miredo倒是不需要重新执行。
开机后未运行任何命令时的网络配置如下:
代码: 全选
xxxx:~$ ifconfig
br-361f98a41e90: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
ether 02:42:54:ce:79:4d txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-fa374fa8f91a: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:f9:89:88:46 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:1e:42:0b:e5 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.91 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::a624:e346:4450:b3b7 prefixlen 64 scopeid 0x20<link>
ether e8:9a:8f:c9:2a:54 txqueuelen 1000 (Ethernet)
RX packets 4993 bytes 4356003 (4.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5399 bytes 641551 (641.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 1 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 689 bytes 56423 (56.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 689 bytes 56423 (56.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
teredo: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1280
inet6 fe80::a52a:8887:57cc:18fe prefixlen 64 scopeid 0x20<link>
inet6 fe80::ffff:ffff:ffff prefixlen 64 scopeid 0x20<link>
inet6 2001:0:53aa:64c:14c1:a37e:4b54:c542 prefixlen 32 scopeid 0x0<global>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19 bytes 1272 (1.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
代码: 全选
xxxx:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
xxxx:~$