Gentoo Archives: gentoo-desktop

From: Brent Busby <brent@×××××××××.org>
To: gentoo-desktop@l.g.o
Subject: [gentoo-desktop] more kde-sunset upgrade notes
Date: Thu, 14 Apr 2011 20:02:51
Message-Id: Pine.LNX.4.64.1104141253190.14095@village.keycorner.org
1 Recently, I've updated to Gnome 2.32.1 on the same system that is also
2 running KDE 3 from sunset. Keeping the two together on a machine that
3 uses KDM 3.5.10 as a login manager is getting interesting.
4
5 Here are some notes for those who may be in a similar situation:
6
7 Recently, Gentoo decided to phase out Hal completely. Hal has been
8 deprecated for some time, but now that pretty much all software that's
9 officially supported from Gentoo's main package pool has been migrated
10 to use Udev-based mechanisms, Gentoo decided to pull the plug on Hal.
11 (Watching 2001 for the nth time might have caused them some anxiety
12 about keeping Hal around any longer too...) Currently, Hal is still in
13 Portage, but probably won't be much longer. I think someone mentioned
14 pulling it into the kde-sunset overlay if it becomes necessary for KDE's
15 sake.
16
17 I've run into some issues on both the KDE 3 and the Gnome sides, which
18 I'll mention separately.
19
20
21 KDE 3 issues:
22
23 The first trouble you'll have is that when Gentoo deprecated Hal, they
24 also got rid of its USE flag, which means even from the kde-sunset
25 overlay, KDE will build without Hal support, even if Hal is installed,
26 and even if you have it enabled in your own USE flags. This will make
27 removable media detection not work, even if hald is running.
28
29 As it turns out, you can contradict the profile yourself by doing "-hal"
30 again yourself in /etc/portage/profile/package.use.mask. The "-hal"
31 from Gentoo and your own "-hal" cancel eachother out to effectively
32 equal "hal" enabled. It's goofy, but it works. There are two packages
33 in KDE that need it, so put this in that file:
34
35 kde-base/kdebase-kioslaves -hal
36 app-cdr/k3b -hal
37
38 You should be able to keep your media detection in KDE now.
39
40
41 Gnome issues:
42
43 It should be mentioned at the start that 90% (if not all) of the issues
44 below are caused by not using GDM as a login manager. Probably KDM 4
45 would work too, since it is receiving current support.
46
47 However, XDM, KDM (3.x), and Slim will all have issues running Gnome
48 now. Details follow...
49
50 Recent versions of Gnome introduced us to PolicyKit, ConsoleKit, and
51 lots of other assorted "kits" that run daemons we never had before,
52 create lots of really ugly messages in syslog about DBus events nobody
53 wants to know about (even on fully working systems that have only Gnome
54 and no deviances), and provide services that nobody I know was asking
55 for. In other words, desktop Linux evolution as usual...
56
57 In the current version of Gnome though, PolicyKit and ConsoleKit have
58 become serious. It's now necessary for PAM to run a module on every
59 login called pam_ck_connector.so. This lets console-kit-daemon know
60 you're logged in. Normally (for systems using GDM or KDM 4), the line
61 in /etc/pam.d/system-login that does this contains the "nox11"
62 parameter, because GDM is itself fully ConsoleKit-aware, and will
63 provide its own plug to the console-kit-daemon without help from PAM.
64 Thus, the "nox11" parameter inhibits the PAM plugin from working for
65 cases of X logins, and makes it cover only TTY's:
66
67 session optional pam_ck_connector.so nox11
68
69 (You probably got this line in your PAM config as part of an update, so
70 it's probably already there. It's not necessary to do anything with it
71 yourself, at least for normal systems.) However, the assumption that
72 we're running a login manager that plugs into console-kit-daemon itself
73 is false if we're running anything but GDM. (It's a Gnome world!)
74
75 First, take the "nox11" part out of that line in
76 /etc/pam.d/system-login. Then, since KDM has its own PAM config that
77 doesn't source the system-login file at all (and thus is missing two
78 needed lines), add the following to the bottom of /etc/pam.d/kde:
79
80 session optional pam_loginuid.so
81 session optional pam_ck_connector.so
82
83 Ah, but we're not done. Now you need to modify the file that provides
84 the login profile in KDM's session menu to choose Gnome. Normally, it
85 just runs "gnome-session", but we need it to run "ck-launch-session
86 gnome-session", so the Gnome launch gets connected to the session in
87 ConsoleKit. (Isn't this nice?) This is not needed for any other window
88 manager I use besides Gnome, so that's the only profile you'll need to
89 adjust this way. Here's my adjusted /usr/share/xsessions/gnome.desktop:
90
91 [Desktop Entry]
92 Name=GNOME
93 Comment=This session logs you into GNOME
94 Exec=ck-launch-session gnome-session
95 TryExec=ck-launch-session
96 Icon=
97 Type=Application
98
99 If you do all of this, you should be able to type "ck-list-sessions" in
100 Gnome and see your login listed as an x11 session, and most importantly,
101 flagged as "active". Mounting removable media should work, though now
102 via udev and udisks-daemon rather than hald. Oddly though, there still
103 must be some magic that GDM would give me that KDM is not providing,
104 because gnome-screensaver now cannot ever detect when the display has
105 been idle long enough to start the screensaver on its own. If I lock
106 the display myself, it works. The display even falls asleep on its own
107 if left idle long enough, so power management is working -- although
108 unlocked, and with no screensaver. It just turns off. A different
109 system which also runs KDE 3 (from sunset) alongside modern Gnome does
110 not have this problem. The difference between them is that it uses GDM
111 for its login manager. GDM seems to do more here than meets the eye.
112
113 The telltale error in syslog is:
114
115 gnome-session[14487]: WARNING: GSIdleMonitor: Unable to initialize Sync
116 extension
117
118 There is nothing in Google about this other than a reference to the
119 actual line in the code that generates the message. Basically,
120 gnome-session is not able to connect to the X11 extension that tells how
121 long the display has been idle. I have no idea why, or what GDM would
122 ordinarily do that sets up this connection. The result though is that
123 the screensaver will never kick in on its own, only under user control.
124
125
126 PARTING THOUGHTS:
127
128 Gnome is getting too complicated for its own good, and about to jump the
129 shark that KDE just fell off of when 4.x came out. Obviously, the
130 intent of all of this is to tie services to the user who is actually at
131 the console. But why?
132
133 Is it really a problem if my removable media is mounted by a remote
134 user? Who says it is? Many times, I have left a DVD in my drive only
135 to access the files on it from somewhere else, logged in on a shell via
136 SSH. It's nice to not have to su to root to access that DVD. It's also
137 nice to not assume I'm on a Gnome desktop using udev,
138 pam_ck_connector.so, console-kit-daemon, ck-launch-session, and Nautilus
139 to see that DVD. It used to be as simple as putting a line in
140 /etc/fstab that allows that mount by regular users.
141
142 Oh! But that was before they made it so that udev would not be able to
143 automatically provide desktop icons or automounting in Gnome if you had
144 such lines in your fstab. For awhile now, it's been necessary to remove
145 lines for DVD's or USB flashdrives if you want Gnome desktop
146 automounting to work. So we've gone from being able to mount a DVD from
147 a bare shell as a regular user, to needing to be on a Gnome desktop, and
148 from there to needing to be on a Gnome desktop that was launched in a
149 ConsoleKit environment with a PAM connector module. Otherwise, you need
150 to be root to mount a DVD.
151
152 It's long been practice of the GNU Project to make versions of
153 historically standard UNIX tools that have more features than the
154 original did. Their tar is a super-tar, their ps is a super-ps, and so
155 on. If we really needed more functionality for detecting who is logged
156 in and from where, couldn't we have just revamped /var/log/wtmp, 'who',
157 'last', and related commands and programs to provide whatever was
158 missing at the UNIX level, to benefit the whole system? Rather than
159 just making more obtuse daemons that seem to be trying to make the whole
160 system into one big platform to run Gnome? And if we need finer
161 permissions to control mounting of media, here's a novel idea: Posix
162 groups! Whoo! Why not just control who can mount with a group, and
163 have the users who can do that controlled by some kind of group policy?
164 Nah, too simple.
165
166 You know, one of the big things that always stood in the way of FreeBSD
167 being a decent desktop platform (even for technically oriented users)
168 was that its fstab syntax has no equivalent to Linux's "users" option.
169 There is only one even approaching-decent way to allow non-root users to
170 mount media in FreeBSD, and that's to set up the Berkeley automounter
171 ("amd" daemon) to do it for you with an automounter map. And as anyone
172 who's ever dealt with the automounter knows, that's a fickle and
173 tempermental solution sure to drive anyone crazy. You don't want to do
174 that? Drop to a shell, and mount your disc as root! That's removable
175 media in the world of FreeBSD on the desktop.
176
177 Now, in Linux, thanks to the fact that Gnome/udev will not automount
178 discs unless the fstab entry is *missing*, and thanks to the fact that
179 Gnome further requires a PolicyKit/ConsoleKit environment to automount
180 media also, even Linux machines with Gnome now have no option to mount
181 removable media without resorting to some form of root access, via su,
182 sudo, or hell why don't we just do what the BSD people do and run an
183 automounter daemon? It's all taken care of if you're in Gnome or modern
184 KDE (4.x), but that's now become an assumption. You can't even be just
185 running a console anymore.
186
187 It'd be nice if the people working on all these desktop technologies
188 would remember that most things always were provided with basic UNIX
189 tools, and if those tools aren't doing what's needed, they can usually
190 just be given new features, like the GNU Project did with most of the
191 standard userland. We don't need more daemons to interact with the
192 other new daemons that we got because we needed to run more daemons.
193
194 --
195 + Brent A. Busby +
196 + Sr. UNIX Systems Admin + Vote for Cthulhu.
197 + University of Chicago +
198 + James Franck Institute + Why settle for the lesser evil?

Replies

Subject Author
[gentoo-desktop] Re: more kde-sunset upgrade notes Duncan <1i5t5.duncan@×××.net>