diff options
| author | Michael Vogt <mvo@ubuntu.com> | 2017-08-30 14:48:42 +0200 |
|---|---|---|
| committer | Michael Vogt <mvo@ubuntu.com> | 2017-08-30 14:48:42 +0200 |
| commit | 20b4f05543c8c071bc300e23c2f604cf9d94bb76 (patch) | |
| tree | 3aca2465b887e442d2eceae57c948cbba5d801e8 | |
| parent | 69c7a9d41fad9bdfcc9a431f254c07f64c5e91e1 (diff) | |
| parent | 5d45712910606158d10ab76436d8e5af2702e362 (diff) | |
Merge remote-tracking branch 'upstream/master' into fix-vendor-jsonfix-vendor-json
| -rw-r--r-- | interfaces/builtin/opengl.go | 2 | ||||
| -rw-r--r-- | tests/main/snap-userd/task.yaml | 47 | ||||
| -rw-r--r-- | userd/userd.go | 4 |
3 files changed, 10 insertions, 43 deletions
diff --git a/interfaces/builtin/opengl.go b/interfaces/builtin/opengl.go index 19fc3ed53a..c83d666531 100644 --- a/interfaces/builtin/opengl.go +++ b/interfaces/builtin/opengl.go @@ -51,7 +51,7 @@ const openglConnectedPlugAppArmor = ` # FIXME: this is an information leak and snapd should instead query udev for # the specific accesses associated with the above devices. - /sys/bus/pci/devices/** r, + /sys/bus/pci/devices/ r, /run/udev/data/+drm:card* r, /run/udev/data/+pci:[0-9]* r, diff --git a/tests/main/snap-userd/task.yaml b/tests/main/snap-userd/task.yaml index 9e9c41f243..36eb848ada 100644 --- a/tests/main/snap-userd/task.yaml +++ b/tests/main/snap-userd/task.yaml @@ -12,12 +12,6 @@ restore: | . "$TESTSLIB/dirs.sh" . "$TESTSLIB/pkgdb.sh" rm -f dbus.env - if [[ "$SPREAD_SYSTEM" == ubuntu-14.04-* ]]; then - stop test-snap-userd || true - rm -f /etc/init/test-snap-userd.conf - else - systemctl stop --signal=KILL test-snap-userd.scope || true - fi umount -f /usr/bin/xdg-open || true umount -f $SNAP_MOUNT_DIR/core/current/usr/bin/xdg-open || true distro_purge_package dbus-x11 xdg-utils @@ -29,11 +23,11 @@ execute: | # Install necessary pacakges to get dbus-launch helper distro_install_package dbus-x11 xdg-utils + # launch dbus session bus dbus-launch > dbus.env export $(cat dbus.env | xargs) - # helper that returns true when io.snapcraft.Launcher.OpenURL - # responds + # wait for session to be ready ping_launcher() { dbus-send --session \ --dest=io.snapcraft.Launcher \ @@ -42,33 +36,9 @@ execute: | / \ org.freedesktop.DBus.Peer.Ping } - - if [[ "$SPREAD_SYSTEM" == ubuntu-14.04-* ]]; then - cat << EOF > /etc/init/test-snap-userd.conf - env DISPLAY="$DISPLAY" - env DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" - env DBUS_SESSION_BUS_PID="$DBUS_SESSION_BUS_PID" - kill timeout 5 - exec /usr/bin/snap userd - EOF - initctl reload-configuration - start test-snap-userd - while ! ping_launcher ; do - sleep .1 - done - else - systemd-run \ - --scope \ - --unit=test-snap-userd \ - --no-block \ - --setenv=DISPLAY="$DISPLAY" \ - --setenv=DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \ - --setenv=DBUS_SESSION_BUS_PID="$DBUS_SESSION_BUS_PID" \ - /bin/sh -c '/usr/bin/snap userd &' - while ! ping_launcher ; do - sleep .1 - done - fi + while ! ping_launcher ; do + sleep .5 + done # Create a small helper which will tell us if snap passes # the URL correctly to the right handler @@ -109,10 +79,3 @@ execute: | test ! -e /tmp/xdg-open-output ! $SNAP_MOUNT_DIR/core/current/usr/bin/xdg-open aabbcc test ! -e /tmp/xdg-open-output - - if [[ "$SPREAD_SYSTEM" == ubuntu-14.04-* ]]; then - stop test-snap-userd - else - systemctl list-units --type=scope # debug - systemctl stop --signal=KILL test-snap-userd.scope || true - fi diff --git a/userd/userd.go b/userd/userd.go index d17018e626..870ac1a4d7 100644 --- a/userd/userd.go +++ b/userd/userd.go @@ -26,6 +26,8 @@ import ( "github.com/godbus/dbus" "github.com/godbus/dbus/introspect" "gopkg.in/tomb.v2" + + "github.com/snapcore/snapd/logger" ) const ( @@ -84,6 +86,8 @@ func (ud *Userd) Init() error { } func (ud *Userd) Start() { + logger.Noticef("Starting snap userd") + ud.tomb.Go(func() error { // Listen to keep our thread up and running. All DBus bits // are running in the background |
