是否有命令检查机器是否已重新启动?
我已经尝试过last reboot | head -3
和who -r
,但我注意到即使在机器关闭时两者也会给出相同的结果。
是否有命令检查机器是否已重新启动?
我已经尝试过last reboot | head -3
和who -r
,但我注意到即使在机器关闭时两者也会给出相同的结果。
我使用的物理服务器(Debian 11 Bullseye)在过去一年一直运行良好,而在过去的这些日子里,它开始表现得很奇怪,它随机重启崩溃,我无法通过检查系统日志找出问题所在。 ..
REBOOT CRASH 1
Nov 26 07:04:01 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:04:01 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:04:57 testing systemd[1]: Starting Collect ipmitool sensor metrics for prometheus-node-exporter...
Nov 26 07:05:01 testing CRON[320608]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Nov 26 07:05:02 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:05:02 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:05:20 testing smartd[1136]: Device: /dev/bus/0 [megaraid_disk_04], SMART Failure: FAILURE PREDICTION THRESHOLD EXCEEDED: ascq=0x5
Nov 26 07:05:57 testing systemd[1]: Starting Collect ipmitool sensor metrics for prometheus-node-exporter...
Nov 26 07:06:01 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:06:01 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:28:51 testing systemd-random-seed[456]: Kernel entropy pool is not initialized yet, waiting until it is.
Nov 26 07:28:51 testing systemd[1]: Starting Flush Journal to Persistent Storage...
Nov 26 07:28:51 testing systemd[1]: Finished Create System Users.
Nov 26 07:28:51 testing systemd[1]: Starting Create Static Device Nodes in /dev...
Nov 26 07:28:51 testing systemd[1]: [email protected]: Succeeded.
Nov 26 07:28:51 testing kernel: [ 0.000000] Linux version 5.10.0-9-amd64 ([email protected]) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.70-1 (2021-09-30)
Nov 26 07:28:51 testing systemd[1]: Finished Load Kernel Module drm.
Nov 26 07:28:51 testing systemd[1]: Finished Coldplug All udev Devices.
Nov 26 07:28:51 testing kernel: [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-9-amd64 root=UUID=14f7f68b-d049-4637-8f99-5441121afaf2412 ro quiet crashkernel=2000M crashkernel=384M-:128M
Nov 26 07:28:51 testing systemd[1]: Starting Helper to synchronize boot up for ifupdown...
Nov 26 07:28:51 testing kernel: [ 0.000000] x86/fpu: x87 FPU will use FXSAVE
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-provided physical RAM map:
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x0000000000010000-0x000000000009ffff] usable
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bc767fff] usable
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bc768000-0x00000000bc867fff] type 20
Nov 26 07:28:51 testing systemd[1]: Finished Set the console keyboard layout.
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bc868000-0x00000000bc967fff] reserved
Nov 26 07:28:51 testing apparmor.systemd[962]: Restarting AppArmor
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bc968000-0x00000000bca66fff] usable
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bca67000-0x00000000bca6bfff] ACPI NVS
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bca6c000-0x00000000bcaebfff] ACPI data
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bcaec000-0x00000000bcf11fff] usable
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bcf42000-0x00000000bcf68fff] usable
Nov 26 07:28:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bd369000-0x00000000bf38efff] reserved
------------------------------------------------------------------------------------------------------------------------------------------------------
REBOOT CRASH 2
Nov 26 07:45:41 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:45:41 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:46:42 testing systemd[1]: Starting Collect ipmitool sensor metrics for prometheus-node-exporter...
Nov 26 07:46:46 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:46:46 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:47:42 testing systemd[1]: Starting Collect ipmitool sensor metrics for prometheus-node-exporter...
Nov 26 07:47:46 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:47:46 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:48:42 testing systemd[1]: Starting Collect ipmitool sensor metrics for prometheus-node-exporter...
Nov 26 07:48:43 testing ddclient[2198]: CONNECT: checkip.dyndns.org
Nov 26 07:48:43 testing ddclient[2198]: CONNECTED: using HTTP
Nov 26 07:48:43 testing ddclient[2198]: SENDING: GET / HTTP/1.0
Nov 26 07:48:43 testing ddclient[2198]: SENDING: Host: checkip.dyndns.org
Nov 26 07:48:43 testing ddclient[2198]: SENDING: User-Agent: ddclient/3.9.1
Nov 26 07:48:43 testing ddclient[2198]: SENDING: Connection: close
Nov 26 07:48:43 testing ddclient[2198]: SENDING:
Nov 26 07:48:43 testing ddclient[2198]: SENDING:
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: HTTP/1.1 200 OK#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: Date: Fri, 26 Nov 2021 06:48:43 GMT#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: Content-Type: text/html#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: Content-Length: 104#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: Connection: close#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: Cache-Control: no-cache#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: Pragma: no-cache#015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: #015
Nov 26 07:48:43 testing ddclient[2198]: RECEIVE: <html><head><title>Current IP Check</title></head><body>Current IP Address: 123.456.78.90</body></html>#015
Nov 26 07:48:43 testing ddclient[2198]: SUCCESS: database.testing.com: skipped: IP address was already set to 123.456.78.90.
Nov 26 07:48:43 testing ddclient[2198]: SUCCESS: jenkins.testing.com: skipped: IP address was already set to 123.456.78.90.
Nov 26 07:48:43 testing ddclient[2198]: SUCCESS: monitors.testing.com: skipped: IP address was already set to 123.456.78.90.
Nov 26 07:48:46 testing systemd[1]: prometheus-node-exporter-ipmitool-sensor.service: Succeeded.
Nov 26 07:48:46 testing systemd[1]: Finished Collect ipmitool sensor metrics for prometheus-node-exporter.
Nov 26 07:49:11 testing kernel: [ 356.406208] perf: interrupt took too long (2501 > 2500), lowering kernel.perf_event_max_sample_rate to 79750
Nov 26 07:56:51 testing systemd-random-seed[448]: Kernel entropy pool is not initialized yet, waiting until it is.
Nov 26 07:56:51 testing systemd[1]: Starting Flush Journal to Persistent Storage...
Nov 26 07:56:51 testing systemd[1]: [email protected]: Succeeded.
Nov 26 07:56:51 testing systemd[1]: Finished Load Kernel Module drm.
Nov 26 07:56:51 testing kernel: [ 0.000000] Linux version 5.10.0-9-amd64 ([email protected]) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.70-1 (2021-09-30)
Nov 26 07:56:51 testing systemd[1]: Finished Coldplug All udev Devices.
Nov 26 07:56:51 testing systemd[1]: Starting Helper to synchronize boot up for ifupdown...
Nov 26 07:56:51 testing kernel: [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-9-amd64 root=UUID=14f7f68b-d049-4637-1234-123456789 ro quiet crashkernel=2000M crashkernel=384M-:128M
Nov 26 07:56:51 testing systemd[1]: Finished Create Static Device Nodes in /dev.
Nov 26 07:56:51 testing kernel: [ 0.000000] x86/fpu: x87 FPU will use FXSAVE
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-provided physical RAM map:
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x0000000000010000-0x000000000009ffff] usable
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000bc767fff] usable
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bc768000-0x00000000bc867fff] type 20
Nov 26 07:56:51 testing systemd[1]: Starting Rule-based Manager for Device Events and Files...
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bc868000-0x00000000bc967fff] reserved
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bc968000-0x00000000bca66fff] usable
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bca67000-0x00000000bca6bfff] ACPI NVS
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bca6c000-0x00000000bcaebfff] ACPI data
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bcaec000-0x00000000bcf11fff] usable
Nov 26 07:56:51 testing kernel: [ 0.000000] BIOS-e820: [mem 0x00000000bcf42000-0x00000000bcf68fff] usable
Nov 23 11:05:13 myserver kernel: [ 2.352549] ata_piix 0000:00:1f.2: version 2.13
Nov 23 11:05:13 myserver kernel: [ 3.576528] sd 0:2:0:0: [sda] Mode Sense: 1f 00 10 08
Nov 23 11:05:13 myserver kernel: [ 3.723306] sr 1:0:0:0: Attached scsi CD-ROM sr0
Nov 23 11:05:13 myserver kernel: [ 4.093233] PM: Image not found (code -22)
Nov 23 11:05:13 myserver kernel: [ 10.167638] checking generic (d5800000 130000) vs hw (d5800000 800000)
Nov 23 12:37:25 myserver PackageKit: daemon start
Nov 26 07:28:51 myserver kernel: [ 0.002793] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
Nov 26 07:28:51 myserver kernel: [ 0.002798] e820: remove [mem 0x000a0000-0x000fffff] usable
Nov 26 07:28:51 myserver kernel: [ 0.002814] MTRR default type: uncachable
Nov 26 07:28:51 myserver kernel: [ 0.002815] MTRR fixed ranges enabled:
Nov 26 07:28:51 myserver kernel: [ 0.002817] 00000-9FFFF write-back
Nov 26 07:28:51 myserver kernel: [ 0.002819] A0000-BFFFF uncachable
Nov 26 07:28:51 myserver kernel: [ 0.002820] C0000-CBFFF write-protect
Nov 26 07:28:51 myserver kernel: [ 0.002822] CC000-D3FFF write-back
Nov 26 07:28:51 myserver kernel: [ 0.002823] D4000-EBFFF uncachable
Nov 26 07:28:51 myserver kernel: [ 0.002825] EC000-FFFFF write-protect
Nov 26 07:28:51 myserver kernel: [ 0.002826] MTRR variable ranges enabled:
Nov 26 07:28:51 myserver kernel: [ 0.002829] 0 base 0000000000 mask FF80000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002831] 1 base 0080000000 mask FFC0000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002833] 2 base 0100000000 mask FF00000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002834] 3 base 0200000000 mask FE00000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002836] 4 base 0400000000 mask FC00000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002838] 5 base 0800000000 mask F800000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002840] 6 base 1000000000 mask F800000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002842] 7 base 1800000000 mask FFC0000000 write-back
Nov 26 07:28:51 myserver kernel: [ 0.002843] 8 disabled
Nov 26 07:28:51 myserver kernel: [ 0.002844] 9 disabled
Nov 26 07:28:51 myserver kernel: [ 0.004625] e820: update [mem 0xc0000000-0xffffffff] usable ==> reserved
Nov 26 07:28:51 myserver kernel: [ 0.021048] e820: update [mem 0xba378000-0xba37afff] usable ==> reserved
Nov 26 07:28:51 myserver kernel: [ 0.022384] ACPI: Local APIC address 0xfee00000
Nov 26 07:28:51 myserver kernel: [ 0.023393] On node 0 totalpages: 12582912
Nov 26 07:28:51 myserver kernel: [ 0.023395] Normal zone: 196608 pages used for memmap
Nov 26 07:28:51 myserver kernel: [ 0.023396] Normal zone: 12582912 pages, LIFO batch:63
Nov 26 07:28:51 myserver kernel: [ 0.023401] On node 1 totalpages: 12569668
Nov 26 07:28:51 myserver kernel: [ 0.023402] DMA zone: 64 pages used for memmap
Nov 26 07:28:51 myserver kernel: [ 0.023404] DMA zone: 3984 pages, LIFO batch:0
Nov 26 07:28:51 myserver kernel: [ 0.023405] DMA32 zone: 12019 pages used for memmap
Nov 26 07:28:51 myserver kernel: [ 0.023407] DMA32 zone: 769204 pages, LIFO batch:63
Nov 26 07:28:51 myserver kernel: [ 0.023408] Normal zone: 184320 pages used for memmap
Nov 26 07:28:51 myserver kernel: [ 0.023410] Normal zone: 11796480 pages, LIFO batch:63
Nov 26 07:28:51 myserver kernel: [ 0.040393] ACPI: Local APIC address 0xfee00000
Nov 26 07:28:51 myserver kernel: [ 0.040434] ACPI: IRQ0 used by override.
Nov 26 07:28:51 myserver kernel: [ 0.040436] ACPI: IRQ9 used by override.
Nov 26 07:28:51 myserver kernel: [ 0.049931] pcpu-alloc: s184152 r8192 d28840 u262144 alloc=1*2097152
Nov 26 07:28:51 myserver kernel: [ 0.040436] ACPI: IRQ9 used by override.
Nov 26 07:28:51 myserver kernel: [ 0.049931] pcpu-alloc: s184152 r8192 d28840 u262144 alloc=1*2097152
Nov 26 07:28:51 myserver kernel: [ 0.049933] pcpu-alloc: [0] 00 02 04 06 08 10 12 14 [0] 16 18 20 22 -- -- -- --
Nov 26 07:28:51 myserver kernel: [ 0.049950] pcpu-alloc: [1] 01 03 05 07 09 11 13 15 [1] 17 19 21 23 -- -- -- --
Nov 26 07:28:51 myserver kernel: [ 0.950514] PCI: root bus fe: using default resources
Nov 26 07:28:51 myserver kernel: [ 0.950516] PCI: Probing PCI hardware (bus fe)
Nov 26 07:28:51 myserver kernel: [ 0.952145] PCI: root bus ff: using default resources
Nov 26 07:28:51 myserver kernel: [ 0.952146] PCI: Probing PCI hardware (bus ff)
Nov 26 07:28:51 myserver kernel: [ 0.953705] PCI: pci_cache_line_size set to 64 bytes
Nov 26 07:28:51 myserver kernel: [ 0.953817] e820: reserve RAM buffer [mem 0xba378000-0xbbffffff]
Nov 26 07:28:51 myserver kernel: [ 0.953820] e820: reserve RAM buffer [mem 0xbc768000-0xbfffffff]
Nov 26 07:28:51 myserver kernel: [ 0.953823] e820: reserve RAM buffer [mem 0xbca67000-0xbfffffff]
Nov 26 07:28:51 myserver kernel: [ 0.953826] e820: reserve RAM buffer [mem 0xbcf12000-0xbfffffff]
Nov 26 07:28:51 myserver kernel: [ 0.953828] e820: reserve RAM buffer [mem 0xbcf69000-0xbfffffff]
Nov 26 07:28:51 myserver kernel: [ 0.974640] system 00:00: Plug and Play ACPI device, IDs PNP0c01 (active)
Nov 26 07:28:51 myserver kernel: [ 0.974699] pnp 00:01: Plug and Play ACPI device, IDs PNP0b00 (active)
Nov 26 07:28:51 myserver kernel: [ 0.975062] pnp 00:02: Plug and Play ACPI device, IDs PNP0501 (active)
Nov 26 07:28:51 myserver kernel: [ 0.975413] pnp 00:03: Plug and Play ACPI device, IDs PNP0501 (active)
Nov 26 07:28:51 myserver kernel: [ 0.976584] system 00:04: Plug and Play ACPI device, IDs PNP0c01 (active)
Nov 26 07:28:51 myserver kernel: [ 0.976656] pnp 00:05: [irq 0 disabled]
Nov 26 07:28:51 myserver kernel: [ 0.976725] system 00:05: Plug and Play ACPI device, IDs IPI0001 PNP0c01 (active)
Nov 26 07:28:51 myserver kernel: [ 0.977664] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
Nov 26 07:28:51 myserver kernel: [ 0.977799] system 00:07: Plug and Play ACPI device, IDs PNP0c02 (active)
Nov 26 07:28:51 myserver kernel: [ 1.847200] intel_idle: MWAIT substates: 0x1120
Nov 26 07:28:51 myserver kernel: [ 1.847270] Monitor-Mwait will be used to enter C-1 state
Nov 26 07:28:51 myserver kernel: [ 1.847287] Monitor-Mwait will be used to enter C-3 state
Nov 26 07:28:51 myserver kernel: [ 1.847390] intel_idle: v0.5.1 model 0x2C
Nov 26 07:28:51 myserver kernel: [ 1.848984] intel_idle: Local APIC timer is reliable in all C-states
Nov 26 07:28:51 myserver kernel: [ 2.168571] with arguments:
Nov 26 07:28:51 myserver kernel: [ 2.168572] /init
Nov 26 07:28:51 myserver kernel: [ 2.168573] with environment:
Nov 26 07:28:51 myserver kernel: [ 2.168575] HOME=/
Nov 26 07:28:51 myserver kernel: [ 2.168576] TERM=linux
Nov 26 07:28:51 myserver kernel: [ 2.168577] BOOT_IMAGE=/boot/vmlinuz-5.10.0-9-amd64
Nov 26 07:28:51 myserver kernel: [ 2.168579] crashkernel=384M-:128M
Nov 26 07:28:51 myserver kernel: [ 2.336535] megaraid_sas 0000:04:00.0: BAR:0x1 BAR's base_addr(phys):0x00000000df1bc000 mapped virt_addr:0x(____ptrval____)
Nov 26 07:28:51 myserver kernel: [ 2.348825] libata version 3.00 loaded.
Nov 26 07:28:51 myserver kernel: [ 2.353143] ata_piix 0000:00:1f.2: version 2.13
Nov 26 07:28:51 myserver kernel: [ 3.577545] sd 0:2:0:0: [sda] Mode Sense: 1f 00 10 08
Nov 26 07:28:51 myserver kernel: [ 3.697853] sr 1:0:0:0: Attached scsi CD-ROM sr0
Nov 26 07:28:51 myserver kernel: [ 4.107713] PM: Image not found (code -22)
Nov 26 07:28:51 myserver kernel: [ 12.677156] checking generic (d5800000 130000) vs hw (d5800000 800000)
Nov 26 07:43:30 myserver kernel: [ 0.002794] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
Nov 26 07:43:30 myserver kernel: [ 0.002799] e820: remove [mem 0x000a0000-0x000fffff] usable
Nov 26 07:43:30 myserver kernel: [ 0.002814] MTRR default type: uncachable
Nov 26 07:43:30 myserver kernel: [ 0.002815] MTRR fixed ranges enabled:
Nov 26 07:43:30 myserver kernel: [ 0.002817] 00000-9FFFF write-back
Nov 26 07:43:30 myserver kernel: [ 0.002819] A0000-BFFFF uncachable
Nov 26 07:43:30 myserver kernel: [ 0.002821] C0000-CBFFF write-protect
Nov 26 07:43:30 myserver kernel: [ 0.002822] CC000-D3FFF write-back
Nov 26 07:43:30 myserver kernel: [ 0.002824] D4000-EBFFF uncachable
Nov 26 07:43:30 myserver kernel: [ 0.002825] EC000-FFFFF write-protect
Nov 26 07:43:30 myserver kernel: [ 0.002827] MTRR variable ranges enabled:
Nov 26 07:43:30 myserver kernel: [ 0.002829] 0 base 0000000000 mask FF80000000 write-back
Nov 26 07:43:30 myserver kernel: [ 0.002831] 1 base 0080000000 mask FFC0000000 write-back
我一直在监控我的 CPU/RAM 使用情况,它从未达到超过 34c 的 CPU 温度,也从未达到超过 30% 的过载。内存使用量约为 70GB 可用...
我不太确定重启的原因,并希望得到任何帮助,我们将不胜感激!
我正在使用以下 3 个命令来检查我的计算机重新启动时的最新时间点:
last reboot
who -b
uptime
上次重启的结果是:
wtmp begins Sat Oct 9 04:49:27 2021
who -b 的结果是:
system boot 2018-01-11 20:52
正常运行时间的结果是:
22:49:01 up 1372 days, ...
似乎 uptime 和 who -b 的结果彼此一致,但与上次重新启动的结果不一致。
我发现这篇文章Uptime 和 who -b 显示系统上次在 Linux 上启动时的不同时间,但它说他的 uptime 和 who -b 彼此不一致,与我的情况不同。
我在这里有一个新手问题。
我在 ESXi 上运行了一些服务器,一些新的 debians,一些旧的 debians,还有一些新的 centOS 和一些旧的 centeOS。
有时我需要扩展磁盘空间,但棘手的部分来了。有没有办法在我扩展 ESXi 中的磁盘后检查服务器是否需要重新启动,因为有时,在工作日/小时内重新启动某些服务器是我不想做的事情。
提前谢谢你们!
我尝试重新启动我的 CentOS 7 服务器,但它给出了荒谬的错误消息。
作为根(当然):
# systemctl reboot
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start reboot.target: Connection timed out
See system logs and 'systemctl status reboot.target' for details.
Exit 1
是否polkit
需要检查是否root
有权重启机器???如果是这样,为什么?
# systemctl status reboot.target
● reboot.target - Reboot
Loaded: loaded (/usr/lib/systemd/system/reboot.target; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
Exit 3
我需要启用reboot
目标吗?为什么默认情况下会禁用此功能?
也许这会起作用?
# systemctl start reboot.target
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to start reboot.target: Connection timed out
See system logs and 'systemctl status reboot.target' for details.
Exit 1
好的,强制它,然后:
# systemctl --force reboot
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to execute operation: Connection timed out
Exit 1
而且服务器还在。
最近,在基于 Oracle Linux(6 或 7)的虚拟机中,我遇到了系统正常运行时间明显错误的任何问题。
# who -b
system boot 2019-07-24 13:21
# last reboot
reboot system boot 3.8.13-44.1.4.el Wed Jul 24 13:21 - 23:24 (10:03)
wtmp begins Wed Aug 22 11:09:06 2018
# hwclock --show
Wed 24 Jul 2019 11:26:11 PM CEST -0.956063 seconds
# uptime
23:24:36 up 10:03, 3 users, load average: 0.63, 0.51, 0.68
# cat /proc/uptime
36320.87 267407.58
系统确实在 13:21 重新启动,这在“who -b”中正确列出,但不知何故“上次重新启动”和“正常运行时间”只显示“10:03”。硬件时钟值正确,正常运行时间值按预期每分钟随时间更新。我没有机会详细重新审视这个问题,但可能很快就得着手解决了。
任何建议为什么会发生这种情况以及如何纠正它?谢谢。
我molly-guard
在所有机器上使用,但有时我想 ssh 进入机器并执行一个脚本,作为最后一步应该重新启动该机器,但随后出现问题molly-guard
并提示我输入主机名。
我正在寻找类似--molly-guard-do-nothing
标志的东西,但它不会什么都不做,它会被调用--molly-guard-do-not-ask
并且不会要求确认。
手册页没有这方面的信息,所以我想知道是否有解决方法。
只有当我 ssh 进入机器时,我才需要它来工作;也就是说,在 cronjob 左右的上下文中永远不需要它,但我不介意它是否也能工作。
更具体地说,这是有问题的脚本:
sudo apt-get update && apt list --upgradable
echo ""
echo "---- ok. what next? ----"
echo ""
read -n 1 -p "exit or upgrade? (E/u) " ans;
case $ans in
u|U) printf "\n\nok, invoking 'sudo apt-get upgrade'\n\n"; sudo apt-get upgrade;;
*) printf "\nok, exited\n\n"; exit;;
esac
echo ""
echo "---- ok. what next? ----"
echo ""
read -n 1 -p "exit, autoremove or reboot? (E/a/r) " ans;
case $ans in
a|A) printf "\n\nok, invoking 'sudo apt-get autoremove'\n\n"; sudo apt-get autoremove;;
r|R) printf "\n\nok, invoking 'sudo reboot'\n\n"; sudo reboot;;
*) printf "\nok, exited\n\n"; exit;;
esac
echo ""
echo "---- ok. what next? ----"
echo ""
read -n 1 -p "exit or reboot? (E/r) " ans;
case $ans in
r|R) printf "\n\nok, invoking 'sudo reboot'\n\n"; sudo reboot;;
*) printf "\nok, exited\n\n"; exit;;
esac
我最近说过使用具有华硕 bios 的 NVIDIA DevBox,以及上面提到的内核版本和 ubuntu 版本。由于某些原因,机器不能像其他笔记本电脑和/或计算机机器一样整夜开机:您可以将其留在机器上,几分钟后它会自行锁定和/或进入睡眠模式- 第二天,一旦您移动鼠标或在键盘上键入内容,计算机就会“取消暂停”或唤醒,您的所有程序都已打开并运行,就像您前一天离开它们的方式一样。
出于某种奇怪的原因,这台机器没有发生这种情况。我之前有一位用户大约一年没有接触过机器,所以他/她可能已经做了一些关于省电的配置,但是当我检查电源选项时一切看起来都很好在我的机器中(我有它暂停 - 1 小时,并锁定 1 小时)。我想我注意到的有趣的事情是,如果我午饭后回来并且机器被锁定/暂停,它会毫无问题地回到会话中,但如果我把它放在一夜之间,那么我第二天就会到达机器已自动关闭。大楼被锁住了,所以其他人不可能在一夜之间按电源关闭按钮,而我'
我在几个地方读到它可能是由于电源不良或损坏而导致的加热问题,但我如何检查是否是这种情况?我有 psensor 应用程序,但这似乎只是实时记录温度,而没有将它们保存到一个文件中,我可以在其中检查任何显卡(有 4 个)或主板的温度。
诊断机器自动关机的另一种方法是什么?我怎么知道是加热问题还是电源故障?或者可能是内核问题?除了我在安装方面非常有经验的 NVIDIA 驱动程序外,这台机器目前没有安装真正的密集程序(几乎是新的),所以也许我可以考虑安装全新的 Ubuntu?- 尽管如果存在硬件问题,这几乎毫无意义
其他详情:
NVIDIA 驱动程序已正确安装。当我强制执行以下命令并且机器连续运行 2 天(这对这些机器来说应该是轻而易举的)时,驱动程序被窃听并且机器响应非常糟糕,直到它在超过 5 分钟后很难运行半夜连续随机重启 2 次:
$ unset autologoff
我必须稍后正确地重新安装驱动程序(并重新设置自动日志选项),并且系统回到其当前状态,如果超过 24 小时不做任何事情(不做任何事情),它“需要”自行关闭因为它没有接收人工输入,但后端进程可能仍在运行)。
pci=noaer
在发现机器给我这个错误后,我添加了in booting: https ://askubuntu.com/questions/771899/pcie-bus-error-severity-corrected
输出:
$ cat /proc/cmdline
是
BOOT_IMAGE=/boot/vmlinuz-4.4.0-137-generic.efi.signed root=UUID=569dd2ad-c5a6-4ae4-a167-f849b8f6ae9e ro quiet splash pci=noaer vt.handoff=7
我已经将 cronjob 创建为 @reboot root sleep 75 && firefox 但后来我对其进行了测试,但它没有用。在 /var/spool/mail/root 它向我显示了这个
我要存档的是每次重新启动后我想自动加载我的Firefox浏览器。想要使用 cron 作业或什至使用 systemd 单元文件作为 Crontab 作业在 @reboot 后开始 +1 分钟执行此操作