[hardy] keytouch blocks logout

Bug #186713 reported by Joachim Beckers on 2008-01-28
Affects Status Importance Assigned to Milestone
keytouch (Debian)
Fix Released
keytouch (Ubuntu)

Bug Description

Binary package hint: keytouch

on hardy, keytouch 2.3.2-2 keeps me from logging out of gnome. when I go to a terminal and kill it, the logout process continues.

I can confirm this bug. It's exactly the same here, except I'm using KDE. Keytouch 2.3.2-2 under hardy.

ScislaC (scislac) wrote :

I have confirmed this as well on Hardy.

Changed in keytouch:
status: New → Confirmed
Brian Murray (brian-murray) wrote :

I've confirmed this on Hardy Heron using keytouch version 2.3.2-2.

Changed in keytouch:
importance: Undecided → High
Brian Murray (brian-murray) wrote :

After logging out just the desktop wallpaper is shown and the system is stuck until all keytouchd processes are killed.

yegle (cnyegle) wrote :

I can confirm this problem.

Ari (ari-reads) wrote :

Same problem. Originally reported in https://bugs.launchpad.net/ubuntu/+bug/206097

As of today, keytouch seems to be consistently crashing during start too.

Hope we can get a fix, it seems that quite a few people is using it.

Joachim Beckers (jbeckers) wrote :

Ari, the crashing is most probably bug 201894. it crashes on startup from time to time.

Having same problem. Shutdown resumes on briefly pressing the power off key however. Verbose messages point to keytouch and network manager on my system.

Marvin (marvin-nospam) wrote :

I am the developer of keyTouch. I have never received reports about this problem before. I think it is some kind of combination of software that causes this problem. However I have no idea what the real cause can be. I guess that when the user logs out, all processes running in that X session will be killed. keytouchd simply exits when it receives a kill signal.

I wish I had time to install Hardy and find out what the cause of this problem is. Unfortunately I do not have this time. If anyone else wants to dive into this problem I am willing to support this person via e-mail. This technical documentation about keyTouch might be useful: http://prdownloads.sourceforge.net/keytouch/keytouch-2.2_tech_manual.pdf?download

Question for the people experiencing this problem: do you use compiz? If so is the problem still there when you use the native window manager of your desktop environment and disable Xgl?

- Marvin Raaijmakers

If nobody else jumps in before me, I'd be happy to give debugging this
problem a go. I'm not running Hardy at the moment because there were a
few too many bugs for me at this stage, but when I install it again
later this month following the release I'd be glad to help.

Chris Dekter

On Sun, 2008-04-06 at 09:51 +0000, Marvin wrote:
> I am the developer of keyTouch. I have never received reports about this
> problem before. I think it is some kind of combination of software that
> causes this problem. However I have no idea what the real cause can be.
> I guess that when the user logs out, all processes running in that X
> session will be killed. keytouchd simply exits when it receives a kill
> signal.
> I wish I had time to install Hardy and find out what the cause of this
> problem is. Unfortunately I do not have this time. If anyone else wants
> to dive into this problem I am willing to support this person via
> e-mail. This technical documentation about keyTouch might be useful:
> http://prdownloads.sourceforge.net/keytouch/keytouch-2.2_tech_manual.pdf?download
> Question for the people experiencing this problem: do you use compiz? If
> so is the problem still there when you use the native window manager of
> your desktop environment and disable Xgl?
> - Marvin Raaijmakers

Joachim Beckers (jbeckers) wrote :

I have no time to debug this issue, but I can tell you that it happens both on my laptop and desktop. the desktop has compiz running on an nvidia card. the laptop has no compiz at all, and runs metacity.

Ari (ari-reads) wrote :

I can also confirm that the problem occurs with and without compiz / desktop-effects. And that the problem is still happening after today's beta updates.

SpookyGhost (francesco-g) wrote :

I confirm this problem. I am using kubuntu hardy . during the logout blocked I can see the
.xsession-errors file grow a lot. The error that I can see, repeated many time in one second is:

 6521 ? S 0:00 keytouchd
 6521 ? S 0:00 keytouchd
 6521 ? S 0:00 keytouchd
 6521 ? S 0:00 keytouchd
 6521 ? S 0:00 keytouchd

I confirm this bug and I close #194936

I confirm this bug in both Ubuntu and Xubuntu Hardy (with latest updates). I removed numlockx to see if it had any relationship, but it doesnt.

Removing keytouch does it.

Ludwig (lvb2k2) wrote :

Same here! Keytouch was a very useful app, I've been using it for a while on my mutimedia keyboard with F-Lock.

Workarounds or alternative apps, anyone?


Hamish Downer (mishd) wrote :

I did find this in my /var/log/messages

Apr 25 13:23:35 whisper kernel: [ 243.484594] keytouchd[9293]: segfault at 8 rip 7f5535c28dc2 rsp 7fff3e42ccc8 error 4

Rob (fryrfxmjpkvw) wrote :

Had same problem here under Hardy Heron LTS 64, after uninstalling keytouch I could shut down in a normal way.

Hamish Downer (mishd) wrote :

Last night when switching off I thought I'd try killing one job at a time. The first job I tried, which did allow the shutdown to continue, was

/usr/bin/seahorse-agent --execute /usr/bin/keytouchd-launch x-session-manager

A quick search finds quite a few bugs that involve seahorse crashing.


So maybe seahorse-agent is the problem. Could others try and see if killing the process involving seahorse-agent and keytouchd is the job that allows the logout/shutdown to continue. To do this, do:

* use Ctrl-Alt-F1 to get a terminal,
* log in
* $ ps -ef | grep keytouch
* kill XXXX

where XXXX is the process ID (the first number in that line) of the seahorse agent line.

Same problem in Kubuntu Hardy. I do not have any seahorse-agent process running, but I found that killing the keytouchd process itself allowed logout/shutdown to continue. So at least for right now, I told KDE to killall keytouchd when it logs out, and that seems to be working ok as a temporary fix.

Ari (ari-reads) wrote :

Is it possible to do in gnome the same the bregol did in KDE? (adding a killall keytouchd in in some shutdown script)... which would that script be?

Might be able to do it by adding the command to:
I really don't deal with gnome that much, but I read some people had other gnome logout commands working by putting the commands in there.

Robert Moerland (veel-mail) wrote :

I'm running Xubuntu 8.04 here, and I have the same problem. When keytouch is functioning, I cannot log out. When I remove keytouch, I can log out. I'm not running seahorse.

After reinstalling my system from the Kubuntu 8.04 KDE4 Remix CD this problem does not occure any more. So how did you guys come to Hardy? Upgrade or fresh install?

Robert Moerland (veel-mail) wrote :

I upgraded Xubuntu 7.10 to 8.04. I did install and remove keytouch a couple of times, but at least that did not help.

I also upgraded Kubuntu 7.10 to 8.04.

I also tried removing ~/.keytouch2 and logging back in. When I went to logout it worked properly. The next time I tried to log out it did not. I then killed keytouchd, put my old ~/.keytouch2 back in place, and started keytouchd back up and it logged out properly once. After trying this a few times and looking at ps aux before logging out, I realized this:
It seems that if only one instance of keytouchd is runnning, the logout goes smoothly. When it hangs when logging out, it appears that 2 or 3 instances of keytouchd are running. Can others confirm this?

Robert Moerland (veel-mail) wrote :

Probably related to bregol's experience: when I removed keytouch and rebooted, I could log out. Then I installed keytouch again, and I could logout once, just the session I reinstalled keytouch in. After a reboot, I could not log out anymore.

Robert Moerland (veel-mail) wrote :

In addition to my previous post, I also noted that more than one instance of keytouch was running, more like 3. I assumed it was normal however.

Federico Belvisi (armalite) wrote :

I upgraded from Gutsy 7.10 to Hardy 8.04 and I had the keytouch problem.

Satanasinc (jabayg) wrote :

Hello guys!!

I resolve the problem editing /etc/gdm/PostSession/Default and adding "killall keytouchd-launch" without quotes.

But i detect the number keyboard dont work with keytouch and Logitech Navigator Keyboard.

Uninstalling keytouch my number keyboard works fine.

Excuse my bad english.

Greetings from spain.

Ludwig (lvb2k2) wrote :

Fresh install of Ubuntu 8.04 amd64, same problem.

Satanasinc (jabayg) wrote :

Hi guys!

My problem solved. In System - Preferences - Keyboard - Mouse Buttons - Disable Use keypad to control mouse.

Excuse if the options name are different but i run spanish version.

Greetings from spain.

i've the same problem. Running from 7.10 to 8.04 updated hardy.
the option satanasinc wrote was already disabled in my settings so this doesnt solve the problem at my system.

oh i just saw i misunderstood something, sry my post was relating to the last thing satanasinc wrote but that doesn't seem to be related to the keytouch problem.

Peter Tarasenko (pit.s) wrote :

Adding disable-session-keytouch line into /etc/X11/Xsession.options solve this problem to me.

Satanasinc (jabayg) wrote :

Hi all!

Dominik Schürmann try this.

In a terminal type:
sudo cp /etc/gdm/PostSession/Default /etc/gdm/PostSession/Default.backup
sudo gedit /etc/gdm/PostSession/Default

(this is my Default)

killall keytouchd-launch
gdmwhich () {
  for dir in $PATH
    if test -x "$dir/$COMMAND" ; then
      if test "x$OUTPUT" = "x" ; then
  echo "$OUTPUT"

exit 0

With this file my computer closes sessions, reboot and shutdown perfectly. This is not a solution only a "patch" but its works.

Good look!

Greetings from spain.

thanks a lot satanasinc, this solved the problem as a workaround

don't have time to play around with this tonight, but i was poking in /etc/X11/Xsession.d and saw that there were 2 different keytouchd_launch files. my question is are there supposed to be 2 files launching keytouchd at X startup? or is this causing multiple keytouchd processes to spawn at X startup? if it is causing multiple keytouchd's to start and if i was right in saying the logout freeze happens when multiple keytouchd processes are running, perhaps this is what the problem is?

Federico Belvisi (armalite) wrote :

Bregol I think you found the real problem, or at least a good point. Thank you for pointing out these duplicate files. After I read your comment, I gone reading the keytouch changelog. Reading from bottom to top, i found some interesting lines:

   - keytouch-acpid no longer needs to be started in the X session, thus
    the Xsession.d scripts are removed. ACPID keys are now handled by a
    daemon started from the init.d script (Closes: #400698).

  * Do not ship upstream's Xsession.d scripts at all. Use the new
    keytouchd-launch to get keytouch started after dbus, allowing us to
    pick up the env vars.

Another line, though I did not understand what is the bug linked here, surely not on LP, maybe on official project website:

* Fix reverted logic in Xsession.d/55keytouchd_launch (Closes: #433589).


 * Fix syntax errors in Xsession.d script (Closes: #435692).

So, why are these Xsessions files still here? I deleted the highest xsession keytouch file, installed keytouch, and I still had logout hangs. I then got rid of every xsession keytouch file (deleted also the 55th xsession keytouch), and gnome logs out correctly. Keytouch seems working as intended at least on my Cherry Expert keyboard. Some of you has tried the same thing?

One other interesting thing to note: At least on my machine here, everytime I open the keytouch config gui and press OK, a new instance of keytouchd spawns.

I'm using a fresh install of Hardy-KDE4. There's only 1 keytouchd_launch file in /etc/X11/Xsession.d, not 2. Disabling this in /etc/X11/Xsession.options left me with a desktop that finally shuts down properly, but the extra keys were not working.
I put a symlink to keytouchd into my KDE4 autostart folder and now it works as expected - exactly 1 keytouchd process (instead of 4) that doesn't block session termination.

I don't think this is the intented way to invoke keytouchd. The changelog mentions keytouchd-launch and dbus. How is this expected to be handled? The hints in the keytouchd-launch manpage are rather vague.

David Mihola (david-mihola) wrote :

I can confirm this problem on Ubuntu Hardy. It was a fresh install (about a week ago) and I have installed all updates since.

I also seem to remember that Gnome logged out normally after the session in which I installed keytouch.

keytouch seems to spawn a new keytouchd process whenever I click "OK" or "Apply". If I manually kill all but one of these keytouchd processes Gnome will log out normally; if there are more than one it doesn't.

This also works if I kill the processes after initiating the Gnome-Logout: I click on logout, the panel etc. are closing but the desktop background remains. I then switch to the console and kill the keytouchd processes one after another; the moment I kill the last but one of them the logout continues and I am back to the GDM-Login.

I tried removing my ~/.keytouch2 directory, and when I logged back in no keytouchd process was running an I could log out normally.
Something else I found interesting: I started keytouch from the shell and set a command for one of the keys; when I hit apply the following was written to the shell: "keytouchd: Kein Prozess abgebrochen" ("keytouchd: No Process killed"). So it seems keytouch TRIES to kill old keytouchd processes when you change the settings; of course if there are none it can't kill any. BUT I also needed to kill (or killall) the processes with "-9" or else they wouldn't be killed - could that be the problem here?

Apart from killing the keytouchd processes a "killall keytouchd-launch" also "allows" Gnome to log out; however if I issue this command from within Gnome it logs me out all by its own, i.e. killing keytouchd-launch seems to kill Gnome (and I go back to GDM Login).

Strangely, adding either "killall keytouchd-launch" or "killall -9 keytouchd" to my /etc/gdm/PostSession/Default does not solve the problem here.

Next, I tried disabling /etc/X11/Xsession.d/55keytouchd_launch (there is only one), by adding "disable-session-keytouch" to /etc/X11/Xsession.options. Naturally the extra keys don't work if I do this, but I can switch them back on by launching keytouch and clicking "Ok". If I do this more than once I still get extra keytouchd processes; in the absence of keytouchd-launch however, they don't seem to block logout...

Just in case anyone is still struggling with this problem, for the moment I use the following workaround:
1. disable /etc/X11/Xsession.d/55keytouchd_launch by adding "disable-session-keytouch" to /etc/X11/Xsession.option
2. save the following script somewhere on your harddisk (e.g. ~/bin/)
--- Begin file contents ---
#! /bin/bash
killall -9 keytouchd
keytouchd &
--- End file contents ---
3. make the file executable
4. add it to the Start-Programs of your gnome session

Excuse my rather lengthy post - but I hope the information provided may be useful for finding the real problem.


Yet another confirm on a kubuntu installation upgraded from 6.06 via 7.04, 7.10 to 8.04.
I had two keytouchd_launch scripts in /etc/X11/Xsession.d, but deleting one didn't change anything, still two keytouchd processes were launched.
However, David Mihola's keytouchd-relaunch script saved to ~/.kde/Autostart works for me.

tremby (ps-launchpad) wrote :

this bug turns out to be the cause of bug <a href="https://bugs.launchpad.net/ubuntu/+bug/217079">#217079</a> too.

i'm another person affected by this, as are my brother and housemate. i can't try the /etc/gdm workaround because i don't have gdm -- i'm running Kubuntu.

please get this sorted out -- there must be many more affected who don't suspect keytouch and so won't find this report. i was looking for the cause for a very long time before finding that killing the keytouch process after a hang caused the shutdown to continue.

as i posted earlier with my experiences in kde, any workaround added in /etc/gdm/PostSession/Default for Gnome is the same as adding an executable script into the ~/.kde/shutdown folder in KDE. So you can use a killall on logout workaround for the time being in KDE similarly as one can do for Gnome.

rainwalker (victi-resurgo) wrote :

Would installing an older version of KeyTouch be a possible solution?

nikoss (nsiolios) wrote :

another confirmation of the same problem after upgrading to ubuntu 8.04 (upgraded from 6.06 via 7.04, 7.10 to 8.04. )

I found that the shutdown worked only if a give from a a terminal window the command:
$shutdown -h now
or after the usual shutdown from the desktop pressing Ctrl+Alt+backspace

but after this shutdown, the computer wakes up by itself at 12 midnight ( to be exactly when bios time is 24:00 - there are no settings in bios for wake up or anything- everything is dissabled) This problem started after the upgrading to 8.04.

It never wakes-up when I terminate the same system from windows.

After reading above uninstalled the keytouch. This solved the problem and it shutdowns from the desktop but the problem with the power up by itself, at 24:00, persists.

sorry for my bad english

Sika (sikamikaniboots) wrote :

I've looked at this bug and I found a fix (I believe). I think the main problem comes from the fact that "keytouchd" should be launched using "keytouchd-launch" script.

keytouchd-launch script launches keytouchd and (should) kill it at the end of the session.
Currently, keytouchd-launch is launched from /etc/X11/Xsession.d/55keytouchd_launch (which is good!).
There's also /etc/X11/Xsession.d/92keytouchd_launch that tries to launch keytouchd directly.

/etc/X11/Xsession.d/92keytouchd_launch is responsible of the second useless keytouchd process.

So here are the things that needs to be corrected:
-/etc/X11/Xsession.d/92keytouchd_launch: I don't know why this file exists as there's already /etc/X11/Xsession.d/55keytouchd_launch that launches keytouch-launch (which launches keytouchd and kill it when necessary). I think it is safe to delete /etc/X11/Xsession.d/92keytouchd_launch

-in /usr/bin/keytouchd-launch, there's a problem: it tries to kill keytouchd at the end of the session. But it cannot as keytouchd is launched by keytouchd-launch. That is why we get blocked at logout. So we need to kill keytouchd-launch instead. A corrected version of /usr/bin/keytouchd-launch is attached.

-in keytouch (the conf editor), when you apply the settings, it tries to kill and relaunch keytouchd. That is why it adds new keytouchd processes (previous process cannot be killed directly). We need to change the sourcecode to use keytouchd-launch instead. In keytouch-config/src/callbacks.c, replace every "keytouchd" by "keytouchd-launch".

I've tested it on my machine and everything work fine now.
Tell me if I'm wrong somewhere...
I don't know how to submit these sort of "patches". I hope it's going to be soon in the repos...

Sika (sikamikaniboots) wrote :

The problems have been identified and a solution has been proposed.

Changed in keytouch:
status: Confirmed → In Progress
SpookyGhost (francesco-g) wrote :

In my installation i have only /etc/X11/Xsession.d/55keytouchd_launch file.

I have tested the /usr/bin/keytouchd-launch proposed and seems work fine .


rainwalker (victi-resurgo) wrote :

Sika your solution worked for me

Mario Di Nicola (warp99) wrote :

If you running KDE you can place a shutdown script is '~./kde/shutdown' or system wide by adding the directory '/usr/shutdown' then placing the script there. I've attached a copy of the shutdown script. Hope this helps.

Marvin (marvin-nospam) wrote :

I found the cause of this problem. While trying to do a clean exit, keytouchd does a call to XCloseDisplay. The problem is that, surprisingly, the program does not return from the XCloseDisplay call and thus doesn't exit. I think can this be described as unexpected behavior of XCloseDisplay, because as far as I know XCloseDisplay should allways return. A work around is to comment out the call to XCloseDisplay in keytouchd/main.c.

- Marvin Raaijmakers

Ari (ari-reads) wrote :

Thanks Marvin!
and... any chance to post a fixed .deb in your launchpad ppa or keytouch's site? 'been missing keytouch for a while now! :)

Thanks a lot for following up on the issue!

rainwalker (victi-resurgo) wrote :

Well I have the issue resolved, but a new one has come up: Occasionally keytouchd will cause my CPU load to soar above 98% until I kill the process; Does this happen to anyone else?

Jerson (jerson) wrote :

I had to remove keytouch for the "logout" issue.

Another thing that I could observe it was that the volume control could not be used with Totem, VLC, and Mplayer in full screen mode.
Sad to say it, but now Ubuntu hardy is working smoothly without keytouch.

Ubuntu Hardy/Gnome 2.22.2
64 Bit
Witout compiz
2 PCs (ATI and Nvidia)

toaste (toaste) wrote :


Sika has posted a working fix for this issue. In the launch script, /usr/bin/keytouchd-launch, repacing the lines to kill keytouchd by pid with killall keytouchd-launch will reliably terminate both processes on logout without hanging.

Sika's corrected keytouchd-launch:
http://launchpadlibrarian.net/14690735/keytouchd-launch_corrected (744 bytes, text/plain)

I can confirm both the bug and this solution.

Julian67 (julianhughes) wrote :

I had the same problem on up to date Debian Lenny on 2 different computers and Sika's modified keytouchd-launch fixed it.

Marvin (marvin-nospam) wrote :

Well this is fixed in the latest release of keyTouch. So now we only need a new deb file. I will ask Guiseppe Borzi if he wants to make one.

- Marvin

RickyS (rickys) wrote :

I can confirm the fix works in 8.04.1 with Keytouch.
Thanks people! I was going crazy!

The following [b]solved[/b] it for me:

Edit /etc/X11/Xsession.d/55keytouchd_launch and replaced the line



KEYTOUCHLAUNCH="/usr/bin/keytouchd-launch --exit-with-session"

gabrielitos (gabrielitos) wrote :

Roland Siegbert's solution works very fine for me, every logout problem were solved!

Colin Mills (cm006a5077) wrote :

I can confirm that Roland Siegbert's solution worked for me as well. No more logout problem with KeyTouch!

Marvin (marvin-nospam) wrote :

I suggest to create a package for keyTouch 2.4.1. In version keytouchd doesn't block because it doesn't call XCloseDisplay() and it also sets the DISPLAY env var to the display of XGL if XGL is running.

- Marvin Raaijmakers

braweheart (braweheart) wrote :

Sorry, but with the above fix the buttons I've setup with Keytouch no longer work at startup, but I still need CTRL+Backspace to shutdown.

Chris S. (cszikszoy) wrote :

Anyone have a .deb for keytouch 2.4.1?


braweheart (braweheart) wrote :

Update. It seems thath it was only temporarily thath I could not shut down with the fix applied, but Keytouch doesn't start for me now. Perhaps 2.4.1 will work better, but I don't know how to try that one

Chris S. (cszikszoy) wrote :

I've looked at the package list for Intrepid, and it still shows keytouch 2.3.2 as the version that'll be in the repos.

2.4.1 fixes these issues, why isn't this updated version in the repos yet?

Ari (ari-reads) wrote :

@Chris: may need to open a bug against the intrepid package asking the package maintainer to update to the newest version.

Changed in keytouch:
importance: Undecided → Unknown
status: New → Unknown
status: In Progress → Confirmed
Changed in keytouch:
status: Unknown → New
Nick Colgan (nick-colgan) wrote :

New package version at bug #255976

Changed in keytouch:
status: New → Incomplete
Chris Halse Rogers (raof) wrote :

This should now fixed in the Debian package version 2.3.2-2.1. Once it's published, we should test that it fixes this in Ubuntu then sync to Intrepid.

Once it's in Intrepid, it sounds like it'd be worth an SRU.

Changed in keytouch:
status: Incomplete → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package keytouch - 2.3.2-2.1ubuntu1

keytouch (2.3.2-2.1ubuntu1) intrepid; urgency=low

  * Resync with Debian Unstable (LP: #186713).
  * Add -D_GNU_SOURCE to CFLAGS, fix FTBFS (LP: #263789).

keytouch (2.3.2-2.1) unstable; urgency=low

  * Non-maintainer upload.
  * fix xsession shutdown problem
  * (closes: #487629)

 -- Luca Falavigna <email address hidden> Tue, 02 Sep 2008 09:47:48 +0000

Changed in keytouch:
status: Confirmed → Fix Released
Luca Falavigna (dktrkranz) wrote :

This issue really seems SRU-worthy. Please prepare a debdiff for hardy-proposed and inform motu-sru, thanks!

fyepo (carlos-jauregui) on 2009-03-19
Changed in keytouch:
status: Fix Released → New
Balaji G (balajig81) wrote :

This bug has been set back to Fix Released state as there is no reason specified for re-opening the bug.


Changed in keytouch (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.