Gentoo Archives: gentoo-user

From: Alessandro DE LAURENZIS <just22.adl@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: [gentoo-user] Registering X session when using startx
Date: Wed, 25 Dec 2013 19:04:10
Message-Id: 20131225190354.GA22355@icarus
1 Folks,
2
3 This is philosophical rather than practical, but I'm struggling with it
4 and I would appreciate your view.
5
6 I normally use startx for logging in X, because that gives me enough
7 flexibility (much more than XDM, 'cause I can open as much servers as
8 needed *when* they are actually needed) not requiring, at the same
9 time, the use of *kit stuff (on my primary laptop I use CDM
10 - https://github.com/ghost1227/cdm - but it doesn't really matter).
11
12 Of course, X sessions are not logged into the utmp/wtmp DBs like it
13 happens using XDM.
14
15 Even if I could live without that, I would prefer to avoid any
16 inconsistencies and, of course, who/w/last commands could be useful for
17 multi-user systems administration.
18
19 So I'm trying to recover their functionality.
20
21 XDM has its own mechanism in /etc/X11/xdm/{Xstartup,Xreset} to log the
22 details using sessreg, but since startx is run as normal user, it isn't
23 reusable within my scope.
24
25 There are a very few info on the matter (see e.g.
26 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466104, closed as
27 WONTFIX) so it seems I'm alone...
28
29 I tried a bunch of WAs in order to be able to use the sessreg command
30 within ~/.xinitrc:
31
32 1) setuid /usr/bin/sessreg: possibly multiple security holes;
33
34 2) use sudo: I really don't understand why, but that doesn't work; I
35 mean, the output from who/w is different w.r.t. the expected one (there
36 is no line related to the active X session, even if the reported number
37 of users seems ok);
38
39 3) adding users to utmp group (which is equivalent to open /var/run/utmp
40 and /var/log/wtmp in writing to all); this is my "favorite hack" at the
41 moment, but I feel it is still suboptimal.
42
43 Any hints? Other strategies adopted? Suggestions related to point 2)?
44
45 I'm looking forward to hearing from gurus!
46
47 Thanks for your time
48
49 --
50 Alessandro DE LAURENZIS
51 [mailto:just22.adl@×××××.com]
52 LinkedIn: http://it.linkedin.com/in/delaurenzis