My current system boots to console and I do not want to use a display manager.
After updating to Ubuntu 13.10, I realised that the ConsoleKit is no longer used for managing user logins and systemd-logind service is used instead.
My .xinitrc config for Ubuntu 13.04 looked like this:
exec ck-launch-session startxfce4
The ck-launch-session enabled me to mount disks or shutdown/reboot/suspend the PC.
The only place where I could find documentation for how to enable these features was in the documentation for Arch Linux:
Users should first set up systemd-logind to manage their session. If systemd is running as the system init daemon, then this is already happening.
Next, the user must launch systemd by putting the following in their
~/.xinitrc:/usr/lib/systemd/systemd --userThe user should remove any instances of
ck-launch-sessionordbus-launchfrom their~/.xinitrc, as those commands are unneeded.
However, as Ubuntu uses upstart and not the systemd, I can't do that on my configuration.
I tried doing something similar so I put this in my .xinitrc:
export DESKTOP_SESSION=xfce
init --user
And the xfce session starts, but I'm still not able to mount the hard disks or reboot, shutdown and suspend my PC. It's effectively the same as calling startxfce4 directly.
If I start the X server with the vt01 argument, where 01 is the id of the current tty, everything works fine, but I can't use stuff like CTRL+C to terminate the server if something hangs. Yes, there are workarounds like calling killall xinit, but this doesn't solve the problem.
I think that I'm not allowed to do shutdown If i start the X server in a new tty is because a new logind session is not cretated. After reading the logind documentation, I realize that I probably need to create a new session upon starting the X server and that session should be marked as active when I'm in the X server. This can be checked with the following command:
loginctl show-session $XDG_SESSION_ID | grep Active
The following line in the logind documentation confuses me:
CreateSession() and ReleaseSession() may be used to open or close login sessions. These calls should never be invoked directly by clients. Creating/closing sessions is exclusively the job of PAM and its pam_systemd module.
So my question is how can I make PAM create a new logind session upon starting the X server?