登录失败求助:输入密码后会话仅持续10秒,无法连接Upstart
Hey there, let's dig into this login problem you're hitting. The error messages in your ~/.xsession-errors tell us two key things: your system's trying to connect to Upstart (an older init system) but can't reach it, and MDM is starting the session setup but failing early. Reinstalling MDM and libcjs0f didn't cut it, so let's try targeted fixes for the root causes:
1. Fix Upstart-Systemd Compatibility
Most modern Ubuntu-based systems use systemd instead of Upstart, but MDM might still be trying to call Upstart's initctl tool. Here's how to work around that:
- First, switch to a text-only tty by pressing
Ctrl+Alt+F3, then log in with your username and password. - Check if your system uses systemd (it almost certainly does):
If the output isps -p 1 -o comm=systemd, we need to create a dummyinitctlto bypass the connection error:sudo ln -s /bin/true /sbin/initctl - Restart MDM to apply the change:
sudo service mdm restart - Head back to the graphical login screen with
Ctrl+Alt+F1and try logging in again.
2. Reset Your User's X Session Configs
Corrupted config files in your home directory can also kill the session before it starts. Let's back them up and let the system generate fresh ones:
- From the same tty login, rename the problematic config directories/files:
mv ~/.config ~/.config_backup mv ~/.Xauthority ~/.Xauthority_backup - Restart MDM once more:
sudo service mdm restart - Try logging in—your system will create new default configs for your session.
3. Replace MDM with LightDM (If All Else Fails)
MDM has had some compatibility issues with systemd in newer releases. Swapping to LightDM, a more modern display manager, might resolve the problem entirely:
- In the tty, install LightDM:
sudo apt update sudo apt install lightdm - During installation, you'll be prompted to choose a default display manager—select
lightdmfrom the list. - Reboot your system to apply the change:
sudo reboot - Use the LightDM login screen to access your system.
Quick Extra Check
Make sure your home directory has the correct ownership (sometimes permissions get messed up and break sessions):
sudo chown -R $USER:$USER ~/
If you're still stuck, you can dig deeper into system logs with journalctl -xe or check /var/log/messages for additional clues about what's failing during session setup.
内容的提问来源于stack exchange,提问作者pawn doe

