slim: Work around broken PAM session handling

Previously logging in via SLiM more than once didn't work because SLiM
doesn't clean up its PAM session properly (that is, in a child rather
than in the parent).  Thus the slim process becomes part of the user
session's cgroup, among other things.  This patch causes SLiM to exit
after the session has finished, after which systemd will restart
display-manager.service.

Fixes NixOS/nixops#137.
This commit is contained in:
Eelco Dolstra 2013-10-15 13:15:33 +02:00
parent 1d634b4388
commit 873662b8ad
3 changed files with 22 additions and 0 deletions

View File

@ -527,6 +527,11 @@ in
'';
script = "${cfg.displayManager.job.execCmd}";
serviceConfig = {
Restart = "always";
RestartSec = "200ms";
};
};
services.xserver.displayManager.xserverArgs =

View File

@ -13,6 +13,11 @@ stdenv.mkDerivation rec {
[ # Allow the paths of the configuration file and theme directory to
# be set at runtime.
./runtime-paths.patch
# Exit after the user's session has finished. This works around
# slim's broken PAM session handling (see
# http://developer.berlios.de/bugs/?func=detailbug&bug_id=19102&group_id=2663).
./run-once.patch
];
preConfigure = "substituteInPlace CMakeLists.txt --replace /etc $out/etc --replace /lib $out/lib";

View File

@ -0,0 +1,12 @@
diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
--- slim-1.3.6-orig/app.cpp 2013-10-15 11:02:55.629263422 +0200
+++ slim-1.3.6/app.cpp 2013-10-15 13:00:10.141210784 +0200
@@ -816,7 +822,7 @@
StopServer();
RemoveLock();
while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
- Run();
+ exit(OK_EXIT);
}
void App::KillAllClients(Bool top) {