Ubuntu Cinnamon未登录时自动关机/休眠且无法通过Wake-on-LAN唤醒的排查方向咨询
Hey Pierre, I totally get how frustrating this weird behavior must be—let’s walk through some targeted areas to investigate based on what you’ve shared so far:
Check display manager-level power settings
Since the issue only happens when you’re not logged in, the problem is probably tied to your login screen’s (display manager) power config, not your user session settings. For Ubuntu Cinnamon, this is often GDM or LightDM. You can dig into their config files:- For GDM, look at
/etc/gdm3/custom.confand check for lines related to idle timeout or power actions - For LightDM, edit
/etc/lightdm/lightdm.confand look foridle-timeoutorautologin-timeoutparameters - You can also use
dconf-editorto navigate toorg.gnome.settings-daemon.plugins.power(even on Cinnamon, some underlying components are shared) and verify if idle actions are set for the system-wide context, not just user sessions.
- For GDM, look at
Inspect systemd-logind configuration
Thesystemd-logindservice manages power events for the system, including idle states when no user is logged in. Check its config file at/etc/systemd/logind.conf—look for settings likeIdleAction,IdleActionSec, and ensure they’re not set topowerofforsuspendif you don’t want that behavior. After making changes, restart the service withsudo systemctl restart systemd-logind.Dig into system logs for triggers
This is key to finding exactly what’s initiating the shutdown/suspend. Use these commands to filter relevant logs:journalctl -b -p warningto see all warning-level events from the current bootjournalctl -b | grep -i "power\|sleep\|suspend\|shutdown"to zero in on power-related actions- Check your display manager’s specific logs with
journalctl -u gdm3(if using GDM) orjournalctl -u lightdmto see if the login screen is triggering the idle action.
Verify Wake-on-LAN (WOL) configuration for pre-login state
Even if WOL works when logged in, the pre-login state might have different network settings:- Use
ethtool <your-network-interface>(replace<your-network-interface>witheth0,enp0s3, etc.) to check ifWake-onis set tog(magic packet). If not, set it withsudo ethtool -s <interface> wol gand make this persistent across reboots by adding the command to/etc/rc.localor a systemd service. - Double-check your BIOS/UEFI settings to ensure WOL is enabled, and confirm that your motherboard supports WOL in the suspend state (some only support it when the system is fully shut down).
- Use
Check BIOS/UEFI power settings
Sometimes hardware-level settings override system configs. Look for options like "Idle Power Savings", "Auto-Suspend on Login Screen", or "Wake-on-LAN Support" in your BIOS/UEFI menu. Ensure these are set to match your desired behavior.
Hopefully these pointers give you a solid starting point to track down the issue—good luck with your troubleshooting!
备注:内容来源于stack exchange,提问作者Pierre Rochefort

