AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-7477

DrAl's questions

Martin Hope
DrAl
Asked: 2016-11-11 08:14:26 +0800 CST

DNS 适用于主机,但不适用于 wget

  • 10

TL;博士

我有一个奇怪的情况,我可以在某些主机上进行 DNS 查找,但不能在其他主机上进行。这似乎与 resolv.conf 有一个名称服务器条目指向我的名称服务器和另一个可能与 docker 有关,但我不知道如何修复它。

问题

我一直在阅读Stéphane Graber 对 LXD 的精彩介绍,并想尝试一下。因此,我做了:

$ sudo usermod -a -G lxd <myusername>
$ newgrp lxd
$ sudo lxd init

我使用所有默认设置对其进行了配置。然后我输入:

$ lxc image list images:
error: Get https://images.linuxcontainers.org/streams/v1/index.json: lookup images.linuxcontainers.org: no such host

一些测试

我尝试从另一台 PC 上的网络浏览器访问该地址,它运行良好。所以我认为 DNS 设置一定有问题,但是:

$ host images.linuxcontainers.org
images.linuxcontainers.org is an alias for canonical.images.linuxcontainers.org.
canonical.images.linuxcontainers.org has address 91.189.91.21
canonical.images.linuxcontainers.org has address 91.189.88.37
canonical.images.linuxcontainers.org has IPv6 address 2001:67c:1560:8001::21
canonical.images.linuxcontainers.org has IPv6 address 2001:67c:1562::41

所以我尝试了wget:

$ wget https://images.linuxcontainers.org/streams/v1/index.json
--2016-11-10 15:56:22--  https://images.linuxcontainers.org/streams/v1/index.json
Resolving images.linuxcontainers.org (images.linuxcontainers.org)... failed: Name or service not known.
wget: unable to resolve host address "images.linuxcontainers.org"

这让我觉得我的互联网连接有问题,但如果我使用 us.images.linuxcontainers.org(我在网上某处看到提到):

$ wget https://us.images.linuxcontainers.org/streams/v1/index.json
--2016-11-10 15:57:26--  https://us.images.linuxcontainers.org/streams/v1/index.json
Resolving us.images.linuxcontainers.org (us.images.linuxcontainers.org)... 91.189.91.21, 2001:67c:1562::41
Connecting to us.images.linuxcontainers.org (us.images.linuxcontainers.org)|91.189.91.21|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3086 (3.0K) [application/json]
Saving to: "index.json"

index.json                                100%[==================================================================================>]   3.01K  --.-KB/s    in 0s

2016-11-10 15:57:26 (8.36 MB/s) - "index.json" saved [3086/3086]

我还尝试了 canonical.images.linuxcontainers.org,它(根据host上面)是 images.linuxcontainers.org 的别名并且也可以工作,所以它看起来host可以查找 images.linuxcontainers.org,而wget不能lxc,但是 wget 可以访问 canonical.images.linuxcontainers.org 和我尝试过的大多数其他网站。

$ wget https://canonical.images.linuxcontainers.org/streams/v1/index.json
--2016-11-10 16:02:28--  https://canonical.images.linuxcontainers.org/streams/v1/index.json
Resolving canonical.images.linuxcontainers.org (canonical.images.linuxcontainers.org)... 91.189.91.21, 91.189.88.37
Connecting to canonical.images.linuxcontainers.org (canonical.images.linuxcontainers.org)|91.189.91.21|:443... connected.
ERROR: no certificate subject alternative name matches
        requested host name "canonical.images.linuxcontainers.org".
To connect to canonical.images.linuxcontainers.org insecurely, use `--no-check-certificate'.

$ wget --no-check-certificate https://canonical.images.linuxcontainers.org/streams/v1/index.json
--2016-11-10 16:02:37--  https://canonical.images.linuxcontainers.org/streams/v1/index.json
Resolving canonical.images.linuxcontainers.org (canonical.images.linuxcontainers.org)... 91.189.88.37, 91.189.91.21
Connecting to canonical.images.linuxcontainers.org (canonical.images.linuxcontainers.org)|91.189.88.37|:443... connected.
WARNING: no certificate subject alternative name matches
        requested host name "canonical.images.linuxcontainers.org".
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://uk.images.linuxcontainers.org/streams/v1/index.json [following]
--2016-11-10 16:02:37--  https://uk.images.linuxcontainers.org/streams/v1/index.json
Resolving uk.images.linuxcontainers.org (uk.images.linuxcontainers.org)... 91.189.88.37, 2001:67c:1560:8001::21
Connecting to uk.images.linuxcontainers.org (uk.images.linuxcontainers.org)|91.189.88.37|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3086 (3.0K) [application/json]
Saving to: "index.json.1"

index.json.1                              100%[==================================================================================>]   3.01K  --.-KB/s    in 0s

2016-11-10 16:02:38 (96.5 MB/s) - "index.json.1" saved [3086/3086]

我也尝试过wget -4排除wget -6IPv6 问题,但结果都是一样的。最后我尝试了一些其他的程序,w3m但也没有区别。

我显然错过了一些东西;任何人都可以就为什么我无法lxc下载图像列表提供任何建议吗?

个人电脑

PC 是运行 Ubuntu Server 16.10 的相对较新的安装,在主主机中安装了很少的附加软件包。Docker 已安装并正在运行,但没有容器启动。有趣的是,我最近重新启动到内核 4.8.6 以测试我遇到的另一个问题,使用该内核我可以访问 images.linuxcontainers.org,但 docker 无法启动,所以我想知道这是否与 docker 有关.

配置

/etc/resolv.conf看起来像这样(但由于某种原因我不知道,实际上是一个符号链接/run/resolvconf/resolv.conf):

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.254
nameserver 127.0.0.53
search lan

如果我查询第一个列出的名称服务器,我会得到与不附加名称服务器地址相同的结果:

$ host images.linuxcontainers.org 192.168.1.254
images.linuxcontainers.org is an alias for canonical.images.linuxcontainers.org.
canonical.images.linuxcontainers.org has address 91.189.91.21
canonical.images.linuxcontainers.org has address 91.189.88.37
canonical.images.linuxcontainers.org has IPv6 address 2001:67c:1560:8001::21
canonical.images.linuxcontainers.org has IPv6 address 2001:67c:1562::41

如果我确实查询第二个,它会超时而没有到达服务器:

$ host images.linuxcontainers.org 127.0.0.53
;; connection timed out; no servers could be reached

如果我查询第二个但使用它的规范名称然后超时???

$ host canonical.images.linuxcontainers.org 127.0.0.53
Using domain server:
Name: 127.0.0.53
Address: 127.0.0.53#53
Aliases:

canonical.images.linuxcontainers.org has address 91.189.88.37
canonical.images.linuxcontainers.org has address 91.189.91.21
;; connection timed out; no servers could be reached
;; connection timed out; no servers could be reached

编辑1:

/etc/nsswitch.conf看起来像这样:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files resolve [!UNAVAIL=return] dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

编辑 2

修改后的 nsswitch.conf 现在看起来像这样:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          files resolve dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

编辑 3

/etc/systemd/resolved.conf 的内容:

#  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.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[Resolve]
#DNS=
#FallbackDNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
#Domains=
#LLMNR=yes
#DNSSEC=no
#Cache=yes
networking
  • 1 个回答
  • 7090 Views
Martin Hope
DrAl
Asked: 2016-11-06 04:28:22 +0800 CST

Ubuntu 16.10 上的英特尔 SkyLake 空白屏幕

  • 6

当我最近在一台新机器上安装 Ubuntu 16.10 时(华擎 Z170 Gaming-ITX/AC S1151 M-ITX 英特尔主板配备英特尔酷睿 Skylake 处理器 i5-6500/3.2 GHz 处理器 CPU),我在第一次启动时出现空白屏幕。

在网上搜索了很多之后,我发现我可以使用nomodeset内核命令行正确引导到 Linux。但是,这限制了我的图形选项,因为xrandr -q只报告一台显示器:

xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1024 x 768, current 1024 x 768, maximum 1024 x 768
default connected 1024x768+0+0 0mm x 0mm
   1024x768      76.00*

我读过很多网站,暗示这是早期内核版本(需要i915.preliminary_hw_support=1)中的一个问题,而 4.3+ 应该没问题,但我有:

Linux mypc 4.8.0-26-generic #28-Ubuntu SMP Tue Oct 18 14:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

所以我认为这应该不是问题。根据我读过的一些网站,我尝试了以下所有内核选项(以及一些随机组合),但没有一个有帮助:

i915.preliminary_hw_support=1
i915.i915_enable_rc6=1
nolapic

在所有情况下,我都删除quiet splash了,以便我可以看到发生了什么。根据选项,可见的启动过程会到达不同的位置。有了nomodeset它一直到虚拟控制台(我从服务器安装开始,所以我可以更好地选择我想要的包)。没有nomodeset,它会达到:

[    5.088899] fb: switching to inteldrmfb from VESA VGA

作为nolapic唯一的补充,它还有几行(我认为都与 SATA 相关)。这可能是相对随机的,因为我已经尝试了几次并且进入了 SATA 的不同阶段(但总是在fb:线路之后的 100 秒左右)

使用i915.i915_enable_rc6=1,我收到一条消息:

i915: unknown parameter 'i915_enable_rc6' ignored`

所以这显然没有做任何事情。

我也尝试过添加i915and nvmeinto /etc/modules,但同样:没有明显的效果。

以上所有内容都来自各种不同的论坛(和这个网站),但恐怕我没有记下所有的参考资料——因此没有链接到任何原始问题。

在空内核行的情况下(只是安装程序添加的东西并且没有nomodeset),如果我 ssh 进入机器并且startx,我可以运行xrandr并查看:

Screen 0: minimum 8 x 8, current 1280 x 1024, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
DP2 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024     60.02 +  75.02
   1920x1080     60.00    59.94
   1152x864      75.00
   1280x720      60.00    59.94
   1024x768      75.03    72.00    70.07    60.00
   800x600       72.19    75.00    60.32    56.25
   720x480       60.00    59.94
   640x480       75.00    72.81    60.00    59.94
   720x400       70.08
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080     60.00 +  50.00    59.94    59.99
   1920x1080i    60.00    50.00    59.94
   1600x1200     60.00
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      59.90
   1280x960      60.00
   1366x768      59.79
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    70.07    60.00
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
  1280x1024 (0x4a) 540.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock 319.91KHz
        v: height 1024 start 1025 end 1028 total 1066           clock 300.10Hz

...表明驱动程序在某种程度上正在工作,屏幕上没有绘制任何内容。

任何人都可以对我做错的事情提出任何建议吗?

我显然可以根据需要添加更多信息,但我现在不确定要添加什么。


编辑 1

这是我当前的 grub 配置 /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

这是 /boot/grub/grub.cfg 中似乎最相关的部分:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c21835f3-4aaf-4880-b573-19a361a72db9' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  c21835f3-4aaf-4880-b573-19a361a72db9
        else
          search --no-floppy --fs-uuid --set=root c21835f3-4aaf-4880-b573-19a361a72db9
        fi
        linux   /boot/vmlinuz-4.8.0-26-generic root=UUID=c21835f3-4aaf-4880-b573-19a361a72db9 ro  nomodeset
        initrd  /boot/initrd.img-4.8.0-26-generic
}

编辑 2

Xorg.log 在这里:http ://pastebin.com/nvNwTPj4

我已经重新启动并(在 grub 编辑屏幕中)删除了 nomodeset 并删除了 gfxmode 行(因为我有一些关于删除 vga= 的评论,但实际上并没有删除 vga=)。这导致与以前相同的空白屏幕。

我也试过只text在引导线上,但这与没有任何东西(switching to inteldrmfb等如上)相同。


编辑 3

根据@Mladen 的建议:

  • 我现在尝试从https://01.org/linuxgraphics/intel-linux-graphics-firmwares安装英特尔图形驱动程序- Skylake 的 - 根据说明安装的 GuC 和 DMC。然后我在没有nomodeset启动线的情况下重新启动,并且屏幕在与其他测试相同的时间点变为空白。不过有趣的是,它说:

    W:模块 i915 可能缺少固件 /lib/firmware/i915/kbl_guc_ver9_14.bin W:模块 i915 可能缺少固件 /lib/firmware/i915/bxt_guc_ver8_7.bin

显示的输出ls -l /lib/firmware/i915:

total 412
-rw-r--r-- 1 root root   8380 Aug 15 15:40 bxt_dmc_ver1_07.bin
lrwxrwxrwx 1 root root     19 Aug 15 15:40 bxt_dmc_ver1.bin -> bxt_dmc_ver1_07.bin
-rw-r--r-- 1 root root   8616 Aug 15 15:40 kbl_dmc_ver1_01.bin
lrwxrwxrwx 1 root root     19 Aug 15 15:40 kbl_dmc_ver1.bin -> kbl_dmc_ver1_01.bin
-rw-r--r-- 1 root root   8824 Sep 14 13:47 skl_dmc_ver1_23.bin
-rw-r--r-- 1 root root   8928 Nov 10 17:54 skl_dmc_ver1_26.bin
lrwxrwxrwx 1 root root     38 Nov 10 17:54 skl_dmc_ver1.bin -> /lib/firmware/i915/skl_dmc_ver1_26.bin
-rw-r--r-- 1 root root 109636 Aug 15 15:40 skl_guc_ver1.bin
-rw-r--r-- 1 root root 128320 Aug 15 15:40 skl_guc_ver4.bin
-rw-r--r-- 1 root root 129024 Nov 10 17:53 skl_guc_ver6_1.bin
lrwxrwxrwx 1 root root     37 Nov 10 17:53 skl_guc_ver6.bin -> /lib/firmware/i915/skl_guc_ver6_1.bin

它显示的固件版本比 initramfs 似乎期望的要早得多

  • 在此之后,我按照此处的说明升级到内核版本 4.8.6(这也报告了上述缺少的固件行)。然后我重新启动(再次没有nomodeset)并再次到达完全相同的位置。

  • 由于上面的错误似乎与 Kabylake 和 Broxton 处理器的固件有关(尽管我很确定我有一个 Skylake 处理器),我从这里下载了这两个处理器的最新文件——但这似乎只是 DMC 的东西。安装这两个会产生关于缺少固件的相同消息(大概是因为它们是 DMC 文件并且版本号不同)。不出所料,结果完全相同:没有nomodeset,屏幕在 之后冻结fb: switching to inteldrmfb from VESA VGA。

根据我的阅读,这些固件文件与未发布的处理器有关,因此无论如何都不太可能相关,但我认为值得一试。


编辑 4

如果有帮助,我已经粘贴了nomodeset boot和non-nomodeset, blank screen bootdmesg的完整输出。有一些差异(包括文件的加载,但我不知道该怎么做...skl_dmc_ver1_26.bin


编辑 5

我现在也用内核 4.8.7 尝试过这个,但行为与 4.8.0 或 4.8.6 相同。安装英特尔微码版本 3.20160714.1 也没有任何明显的区别。


编辑 6

如果这被证明是与此相关的内核错误,我在内核 bugzilla 页面上提出了一个错误 - https://bugzilla.kernel.org/show_bug.cgi?id=187601

multiple-monitors
  • 4 个回答
  • 4681 Views
Martin Hope
DrAl
Asked: 2010-12-17 02:08:32 +0800 CST

需要 sudo 密码才能关闭一个会话

  • 2

我有一台运行 Ubuntu 的计算机,可供多人使用。它会花费大量时间关闭电源。有时,我想使用 Wake-On-Lan 启动它,通过 ssh 连接并在后台开始工作。我不希望 PC 在此作业运行时关闭。

但是,由于可能有多人使用这台 PC,因此有人可以走到机器前,登录,检查他们的电子邮件或其他任何内容,然后关闭 PC。或者,有人可能会注意到它已打开并显示 GDM 登录屏幕并决定将其关闭。

有没有办法防止这种情况发生?不必让它完全不可能:只需让计算机弹出一个窗口,上面写着“你真的确定(作业在后台运行)吗?” 会做得很好。但是,它必须在登录后的 Gnome 菜单和 GDM 屏幕中都可以使用。

shutdown gdm remote
  • 2 个回答
  • 651 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve