Message: previous - next
Month: February 2014

Re: [trinity-devel] TDE running on systemd will require code changes proper session tracking?

From: "David C. Rankin" <drankinatty@...>
Date: Mon, 03 Feb 2014 14:40:04 -0600
On 02/03/2014 02:02 PM, David C. Rankin wrote:
> On 02/03/2014 01:01 PM, Slávek Banko wrote:
>>> Is there anything we can add to /etc/profile.d/ that might
>>>> help?
>> I assume that the essence of 'good conduct' on Ubuntu Saucy's is presence 
>> ConsoleKit and creating ConsoleKit session in TDM. I'm afraid that the 
>> absence ConsoleKit requires to add SystemD session management into TDM.
>> Right now I search the entire git tree if anything use XDG_SESSION_COOKIE, 
>> which is specific for ConsoleKit. Such would require a fix for 
>> the "clean" SystemD session.
> Slavek,
>   What graphical authentication agent does TDE load? Does it work with polkit?
> Also, I found:
> 14:00 phoinix:/dat_e/tde/tde/main/tdebase> grep -rn XDG_SESSION_COOKIE *
> tdm/backend/client.c:1315:              env = setEnv ( env,
> "XDG_SESSION_COOKIE", ck_session_cookie );
> tdm/backend/client.c:1320:              env = setEnv ( env,
> "XDG_SESSION_COOKIE", ck_session_cookie );
>   So what kind of fix do we need?

There are already preprocessor checks around the consolekit code, so in Arch's
case, they should not even be part of the build:

	if (ck_session_cookie != NULL) {
		env = setEnv ( env, "XDG_SESSION_COOKIE", ck_session_cookie );
	if (ck_session_cookie != NULL) {
		env = setEnv ( env, "XDG_SESSION_COOKIE", ck_session_cookie );

The question become what do we need to add to accommodate systemd. Can we
implement the following in the same place?

Minimal porting (without multi-seat) requires the following:

    Remove/disable all code responsible for registering your service with
    Make sure to register your greeter session via the PAM session stack, and
make sure the PAM session modules include pam_systemd. Also, make sure to set
the session class to "greeter." This may be done by setting the environment
variable XDG_SESSION_CLASS to "greeter" with pam_misc_setenv() or setting the
"class=greeter" option in the pam_systemd module, in order to allow applications
to filter out greeter sessions from normal login sessions.
    Make sure to register your logged in session via the PAM session stack as
well, also including pam_systemd in it.
    Optionally, use pam_misc_setenv() to set the environment variables XDG_SEAT
and XDG_VTNR. The former should contain "seat0", the latter the VT number your
session runs on. pam_systemd can determine these values automatically but it's
nice to pass these variables anyway. In summary: porting a display manager from
ConsoleKit to systemd primarily means removing code, not necessarily adding any
new code. Here, a cheers to simplicity!

David C. Rankin, J.D.,P.E.