如何从日志中找到唤醒原因?(最近机器半夜有规律地醒来。)
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0040] manager: sleep requested (sleeping: no enabled: yes)
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0040] manager: sleeping...
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0040] manager: NetworkManager state is now ASLEEP
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0042] device (enp9s0): state change: activated -> deactivating (reason 'sleeping') [100 110 37]
srp 14 02:51:12 martin-lin whoopsie[1522]: [02:51:12] offline
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0083] device (enp9s0): state change: deactivating -> disconnected (reason 'sleeping') [110 30 37]
srp 14 02:51:12 martin-lin gnome-session[3498]: (deja-dup-monitor:6774): GLib-CRITICAL **: Source ID 91 was not found when attempting to remove it
srp 14 02:51:12 martin-lin avahi-daemon[975]: Withdrawing address record for fe80::fdbc:1966:4bb2:88b2 on enp9s0.
srp 14 02:51:12 martin-lin avahi-daemon[975]: Leaving mDNS multicast group on interface enp9s0.IPv6 with address fe80::fdbc:1966:4bb2:88b2.
srp 14 02:51:12 martin-lin avahi-daemon[975]: Interface enp9s0.IPv6 no longer relevant for mDNS.
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0407] dhcp4 (enp9s0): canceled DHCP transaction, DHCP client pid 13319
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0408] dhcp4 (enp9s0): state changed bound -> done
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0412] dns-mgr: Writing DNS information to /sbin/resolvconf
srp 14 02:51:12 martin-lin avahi-daemon[975]: Withdrawing address record for 192.168.0.17 on enp9s0.
srp 14 02:51:12 martin-lin avahi-daemon[975]: Leaving mDNS multicast group on interface enp9s0.IPv4 with address 192.168.0.17.
srp 14 02:51:12 martin-lin avahi-daemon[975]: Interface enp9s0.IPv4 no longer relevant for mDNS.
srp 14 02:51:12 martin-lin dnsmasq[1371]: setting upstream servers from DBus
srp 14 02:51:12 martin-lin whoopsie[1522]: [02:51:12] Cannot reach: https://daisy.ubuntu.com
srp 14 02:51:12 martin-lin dbus[994]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0459] device (enp9s0): state change: disconnected -> unmanaged (reason 'sleeping') [30 10 37]
srp 14 02:51:12 martin-lin systemd[1]: Starting Network Manager Script Dispatcher Service...
srp 14 02:51:12 martin-lin NetworkManager[1031]: <info> [1502671872.0501] device (enp9s0): link disconnected
srp 14 02:51:12 martin-lin dbus[994]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
srp 14 02:51:12 martin-lin systemd[1]: Started Network Manager Script Dispatcher Service.
srp 14 02:51:12 martin-lin whoopsie[1522]: [02:51:12] Cannot reach: https://daisy.ubuntu.com
srp 14 02:51:12 martin-lin nm-dispatcher[13996]: req:1 'down' [enp9s0]: new request (1 scripts)
srp 14 02:51:12 martin-lin nm-dispatcher[13996]: req:1 'down' [enp9s0]: start running ordered scripts...
srp 14 02:51:12 martin-lin systemd[1]: Reached target Sleep.
srp 14 02:51:12 martin-lin systemd[1]: Starting Suspend...
srp 14 02:51:12 martin-lin systemd-sleep[14038]: Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory
srp 14 02:51:12 martin-lin systemd-sleep[14039]: /lib/systemd/system-sleep/wpasupplicant failed with error code 255.
srp 14 02:51:12 martin-lin systemd-sleep[14038]: Suspending system...
srp 14 02:51:12 martin-lin kernel: PM: Syncing filesystems ... done.
srp 14 02:51:12 martin-lin kernel: PM: Preparing system for sleep (mem)
srp 14 03:47:58 martin-lin kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
srp 14 03:47:58 martin-lin kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
srp 14 03:47:58 martin-lin kernel: PM: Suspending system (mem)
srp 14 03:47:58 martin-lin kernel: Suspending console(s) (use no_console_suspend to debug)
srp 14 03:47:58 martin-lin kernel: sd 1:0:0:0: [sdb] Synchronizing SCSI cache
srp 14 03:47:58 martin-lin kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
srp 14 03:47:58 martin-lin kernel: sd 0:0:0:0: [sda] Stopping disk
srp 14 03:47:58 martin-lin kernel: sd 1:0:0:0: [sdb] Stopping disk
srp 14 03:47:58 martin-lin kernel: serial 00:01: disabled
srp 14 03:47:58 martin-lin kernel: PM: suspend of devices complete after 694.805 msecs
srp 14 03:47:58 martin-lin kernel: PM: late suspend of devices complete after 0.923 msecs
srp 14 03:47:58 martin-lin kernel: pcieport 0000:03:00.0: System wakeup enabled by ACPI
srp 14 03:47:58 martin-lin kernel: xhci_hcd 0000:00:14.0: System wakeup enabled by ACPI
srp 14 03:47:58 martin-lin kernel: PM: noirq suspend of devices complete after 37.924 msecs
srp 14 03:47:58 martin-lin kernel: ACPI: Preparing to enter system sleep state S3
srp 14 03:47:58 martin-lin kernel: PM: Saving platform NVS memory
srp 14 03:47:58 martin-lin kernel: Disabling non-boot CPUs ...
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 1 is now offline
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 2 is now offline
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 3 is now offline
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 126
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 4 is now offline
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 126
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 5 is now offline
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 126
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 6 is now offline
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 126
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 128
srp 14 03:47:58 martin-lin kernel: Broke affinity for irq 136
srp 14 03:47:58 martin-lin kernel: smpboot: CPU 7 is now offline
srp 14 03:47:58 martin-lin kernel: ACPI: Low-level resume complete
srp 14 03:47:58 martin-lin kernel: PM: Restoring platform NVS memory
srp 14 03:47:58 martin-lin kernel: Suspended for 3402.944 seconds
srp 14 03:47:58 martin-lin kernel: Enabling non-boot CPUs ...
srp 14 03:47:58 martin-lin kernel: x86: Booting SMP configuration:
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 1 APIC 0x2
srp 14 03:47:58 martin-lin kernel: cache: parent cpu1 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU1 is up
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 2 APIC 0x4
srp 14 03:47:58 martin-lin kernel: cache: parent cpu2 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU2 is up
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 3 APIC 0x6
srp 14 03:47:58 martin-lin kernel: cache: parent cpu3 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU3 is up
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 4 APIC 0x1
srp 14 03:47:58 martin-lin kernel: cache: parent cpu4 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU4 is up
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 5 APIC 0x3
srp 14 03:47:58 martin-lin kernel: cache: parent cpu5 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU5 is up
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 6 APIC 0x5
srp 14 03:47:58 martin-lin kernel: cache: parent cpu6 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU6 is up
srp 14 03:47:58 martin-lin kernel: smpboot: Booting Node 0 Processor 7 APIC 0x7
srp 14 03:47:58 martin-lin kernel: cache: parent cpu7 should not be sleeping
srp 14 03:47:58 martin-lin kernel: CPU7 is up
srp 14 03:47:58 martin-lin kernel: ACPI: Waking up from system sleep state S3
srp 14 03:47:58 martin-lin kernel: xhci_hcd 0000:00:14.0: System wakeup disabled by ACPI
srp 14 03:47:58 martin-lin kernel: pcieport 0000:03:00.0: System wakeup disabled by ACPI
srp 14 03:47:58 martin-lin kernel: PM: noirq resume of devices complete after 37.952 msecs
srp 14 03:47:58 martin-lin kernel: PM: early resume of devices complete after 0.910 msecs
srp 14 03:47:58 martin-lin kernel: usb usb1: root hub lost power or was reset
srp 14 03:47:58 martin-lin kernel: usb usb2: root hub lost power or was reset
srp 14 03:47:58 martin-lin kernel: usb usb3: root hub lost power or was reset
srp 14 03:47:58 martin-lin kernel: usb usb4: root hub lost power or was reset
srp 14 03:47:58 martin-lin kernel: serial 00:01: activated
srp 14 03:47:58 martin-lin kernel: rtc_cmos 00:04: System wakeup disabled by ACPI
srp 14 03:47:58 martin-lin kernel: sd 0:0:0:0: [sda] Starting disk
srp 14 03:47:58 martin-lin kernel: sd 1:0:0:0: [sdb] Starting disk
srp 14 03:47:58 martin-lin kernel: ata4: SATA link down (SStatus 4 SControl 300)
srp 14 03:47:58 martin-lin kernel: ata3: SATA link down (SStatus 4 SControl 300)
srp 14 03:47:58 martin-lin kernel: ata5: SATA link down (SStatus 4 SControl 300)
srp 14 03:47:58 martin-lin kernel: ata6: SATA link down (SStatus 4 SControl 300)
srp 14 03:47:58 martin-lin kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
srp 14 03:47:58 martin-lin kernel: ata1.00: supports DRM functions and may not be fully accessible
srp 14 03:47:58 martin-lin kernel: ata1.00: disabling queued TRIM support
srp 14 03:47:58 martin-lin kernel: ata1.00: supports DRM functions and may not be fully accessible
srp 14 03:47:58 martin-lin kernel: ata1.00: disabling queued TRIM support
srp 14 03:47:58 martin-lin kernel: ata1.00: configured for UDMA/133
srp 14 03:47:58 martin-lin kernel: usb 1-14: reset low-speed USB device number 3 using xhci_hcd
srp 14 03:47:58 martin-lin kernel: usb 1-13: reset low-speed USB device number 2 using xhci_hcd
srp 14 03:47:58 martin-lin kernel: PM: resume of devices complete after 1384.762 msecs
srp 14 03:47:58 martin-lin kernel: PM: Finishing wakeup.
srp 14 03:47:58 martin-lin kernel: Restarting tasks ...
srp 14 03:47:58 martin-lin kernel: pci_bus 0000:04: Allocating resources
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: bridge window [mem 0x00100000-0x000fffff] to [bus 06] add_size 400000 add_align 100000
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: bridge window [mem 0x00100000-0x000fffff] to [bus 08] add_size 400000 add_align 100000
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: res[14]=[mem 0x00100000-0x000fffff] res_to_dev_res add_size 400000 min_align 100000
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: res[14]=[mem 0x00100000-0x004fffff] res_to_dev_res add_size 400000 min_align 100000
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: res[14]=[mem 0x00100000-0x000fffff] res_to_dev_res add_size 400000 min_align 100000
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: res[14]=[mem 0x00100000-0x004fffff] res_to_dev_res add_size 400000 min_align 100000
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: BAR 14: no space for [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: BAR 14: failed to assign [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: BAR 14: no space for [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: BAR 14: failed to assign [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: BAR 14: no space for [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:04.0: BAR 14: failed to assign [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: BAR 14: no space for [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: pcieport 0000:04:01.0: BAR 14: failed to assign [mem size 0x00400000]
srp 14 03:47:58 martin-lin kernel: done.
srp 14 03:47:58 martin-lin systemd[1]: Time has been changed
srp 14 03:47:58 martin-lin systemd[3267]: Time has been changed
srp 14 03:47:58 martin-lin systemd-sleep[14038]: System resumed.
srp 14 03:47:58 martin-lin systemd-sleep[14038]: Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory
srp 14 03:47:58 martin-lin systemd-sleep[14130]: /lib/systemd/system-sleep/wpasupplicant failed with error code 255.
srp 14 03:47:58 martin-lin acpid[1040]: client 1196[0:0] has disconnected
srp 14 03:47:58 martin-lin acpid[1040]: client connected from 1196[0:0]
srp 14 03:47:58 martin-lin acpid[1040]: 1 client rule loaded
srp 14 03:48:02 martin-lin kernel: ata2: link is slow to respond, please be patient (ready=0)
srp 14 03:48:07 martin-lin kernel: ata2: COMRESET failed (errno=-16)
srp 14 03:48:07 martin-lin kernel: ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
srp 14 03:48:07 martin-lin kernel: ata2.00: configured for UDMA/133
srp 14 03:48:07 martin-lin systemd[1]: Started Suspend.
srp 14 03:48:07 martin-lin systemd[1]: sleep.target: Unit not needed anymore. Stopping.
srp 14 03:48:07 martin-lin systemd[1]: Stopped target Sleep.
srp 14 03:48:07 martin-lin systemd[1]: Reached target Suspend.
srp 14 03:48:07 martin-lin systemd-logind[1034]: Operation 'sleep' finished.
srp 14 03:48:07 martin-lin systemd[1]: suspend.target: Unit is bound to inactive unit systemd-suspend.service. Stopping, too.
srp 14 03:48:07 martin-lin systemd[1]: Stopped target Suspend.
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7089] manager: wake requested (sleeping: yes enabled: yes)
srp 14 03:48:07 martin-lin systemd[1]: Started Run anacron jobs at resume.
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7090] manager: waking up...
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7091] device (enp9s0): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
srp 14 03:48:07 martin-lin kernel: IPv6: ADDRCONF(NETDEV_UP): enp9s0: link is not ready
srp 14 03:48:07 martin-lin kernel: IPv6: ADDRCONF(NETDEV_UP): enp9s0: link is not ready
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7125] manager: NetworkManager state is now DISCONNECTED
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7128] device (enp9s0): link connected
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7134] device (enp9s0): state change: unavailable -> disconnected (reason 'carrier-changed') [20 30 40]
srp 14 03:48:07 martin-lin systemd[1]: Started Run anacron jobs.
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7141] policy: auto-activating connection 'Wired connection 1'
srp 14 03:48:07 martin-lin anacron[14185]: Anacron 2.3 started on 2017-08-14
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-WARNING **: Can't set a parent on widget which has a parent
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7147] device (enp9s0): Activation: starting connection 'Wired connection 1' (30b4c0bb-bd63-3c83-814e-911361edb02b)
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7148] device (enp9s0): state change: disconnected -> prepare (reason 'none') [30 40 0]
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7149] manager: NetworkManager state is now CONNECTING
srp 14 03:48:07 martin-lin anacron[14185]: Normal exit (0 jobs run)
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7151] device (enp9s0): state change: prepare -> config (reason 'none') [40 50 0]
srp 14 03:48:07 martin-lin kernel: alx 0000:09:00.0 enp9s0: NIC Up: 1 Gbps Full
srp 14 03:48:07 martin-lin kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp9s0: link becomes ready
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7155] device (enp9s0): state change: config -> ip-config (reason 'none') [50 70 0]
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7157] dhcp4 (enp9s0): activation: beginning transaction (timeout in 45 seconds)
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-WARNING **: Can't set a parent on widget which has a parent
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7172] dhcp4 (enp9s0): dhclient started with pid 14188
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-WARNING **: Can't set a parent on widget which has a parent
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-WARNING **: Can't set a parent on widget which has a parent
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
srp 14 03:48:07 martin-lin gnome-session[3498]: (nm-applet:4072): Gtk-CRITICAL **: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
答案1
从您的日志来看,我认为是网络问题:
srp 14 03:48:07 martin-lin NetworkManager[1031]: <info> [1502675287.7089] manager: wake requested (sleeping: yes enabled: yes)
也许如果你将内核日志级别设置为更高的值,你将获得比这更多的信息