Comment 1 for bug 1333215

Revision history for this message
Martin Pitt (pitti) wrote : Re: "Unable to find keyfile for application": fails to create .desktop symlinks in ~/.cache

Reproducer:

1. Create a suitable container:
sudo lxc-create -n click -t ubuntu -- -r utopic
sudo lxc-start -n click
# log in as ubuntu/ubuntu, then run
sudo apt-get install -y --no-install-recommends click ubuntu-sdk-libs ubuntu-app-launch{,-tools} dbus-x11 xvfb bzr ca-certificates wget
sudo poweroff

2. Start ephemeral container (so that you can run this test multiple times):
sudo lxc-start-ephemeral -o click
# log in as ubuntu/ubuntu

3. Get the current calculator .click package. I just built it myself, and as it's difficult to get the official ones, I put it on people:
wget http://people.canonical.com/~pitti/tmp/com.ubuntu.calculator_1.3.283_all.click

4. Start X server
Xvfb :5 -screen 0 1024x768x24 >/dev/null 2>&1 &
export DISPLAY=:5
export XAUTHORITY=/dev/null

5. Start upstart session:
mkdir /tmp/r
export XDG_RUNTIME_DIR=/tmp/r
# some tests fail with German locale
export LANG=en_US.UTF-8
/sbin/init --user &
sleep 1
. /tmp/r/upstart/sessions/$!.session
export UPSTART_SESSION
export DBUS_SESSION_BUS_ADDRESS=`/sbin/initctl get-env DBUS_SESSION_BUS_ADDRESS`

6. Install click package:
# avoid tripping over AppArmor restrictions in container in click hook
sudo rm /sbin/apparmor_parser
sudo click install --all-users com.ubuntu.calculator_*.click

7. Try to launch click app:
ubuntu-app-launch `ubuntu-app-triplet com.ubuntu.calculator`

This reproduces the error.

If I install the click package *before* launching upstart's user session, it *does* work. I. e. run step 6 before step 5, then upstart-app-launch (or something else) creates

lrwxrwxrwx 1 ubuntu ubuntu 102 Jun 23 13:44 .cache/ubuntu-app-launch/desktop/com.ubuntu.calculator_calculator_1.3.283.desktop -> /opt/click.ubuntu.com/.click/users/@all/com.ubuntu.calculator/com.ubuntu.calculator_calculator.desktop

So it seems this only affects click apps which get installed in an already running session.