Daemon crashes with "run.sh" wrapper (was: Application with keys to run from the script)

So I’ve been looking at your snap and I see the following things:

The daemon fails to start with

wrz 25 15:07:09 fyke bsp095project.BSP095launcherCoreDaemon[22197]: /snap/bsp095project/x1/bin/./CORE: relocation error: /snap/bsp095project/x1/lib/x86_64-linux-gnu/libdl.so.2: symbol _dl_catch_error, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

This looks like an error that I saw on other systems but I cannot make heads or tails of it. Since it may be caused by my use of Ubuntu 17.10 to build the snap I’ve decided to rebuild the snap with snapcraft cleanbuild. (This took a while).

With the snap rebuilt I’m getting this:

wrz 25 16:02:00 fyke audit[29898]: AVC apparmor="DENIED" operation="mkdir" profile="snap.bsp095project.BSP095launcherCoreDaemon" name="/run/user/0/" pid=29898 comm="mkdir" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
wrz 25 16:02:00 fyke bsp095project.BSP095launcherCoreDaemon[29872]: mkdir: cannot create directory '/run/user/0': Permission denied
wrz 25 16:02:00 fyke kernel: kauditd_printk_skb: 1 callbacks suppressed
wrz 25 16:02:00 fyke kernel: audit: type=1400 audit(1506348120.023:147): apparmor="DENIED" operation="mkdir" profile="snap.bsp095project.BSP095launcherCoreDaemon" name="/run/user/0/" pid=29898 comm="mkdir" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
wrz 25 16:02:00 fyke bsp095project.BSP095launcherCoreDaemon[29872]: QXcbConnection: Could not connect to display
wrz 25 16:02:00 fyke bsp095project.BSP095launcherCoreDaemon[29872]: /snap/bsp095project/x1/bin/./core_daemon_new.sh: line 15: 29902 Aborted                 (core dumped) $SNAP/bin/./CORE -D "$HOME" -T "$HOME" -S "${1:-${RANDOM}}"

So it seems to be crashing on permissions needed to create /run/user/0. I don’t see anything related to command line parsing. I had a look at the huge run.sh wrapper script and I suspect partially it is responsible for the crash. I don’t think it should do all those things you made it do. For headless daemon application you can probably start without the wrapper and see what you really need.

Let me know if you need more help.

Hey @zyga-snapd
Graphic application also failed to start? BTL095 and maintenance
The question is specifically related to Ubuntu-core.

I checked the daemon only. Let me look at the graphic apps.

EDIT: The GUI doesn’t start as well but it looks like some libraries are not around

zyga@fyke:~/Pobrane/foobarsnap/BSP3_X11$ bsp095project.BSP095launcherGui 
Starting GUI application ...
cat: /home/zyga/snap/bsp095project/x1/PrimaryKey: No such file or directory
cat: /home/zyga/snap/bsp095project/x1/SecondaryKey: No such file or directory
/snap/bsp095project/x1/bin/./BTL095: error while loading shared libraries: libpulse.so.0: cannot open shared object file: No such file or directory

And indeed this library is not present in your snap.

If I understand you correctly that to run on X11, this library was not needed and without this library it was launched, but on the Mir is needed?
Found a package where this library is present, libpulse0

I only tried the X11 package, I don’t have a working setup where I could try the mir variant. In any case I don’t think your package has issues because of any command line parsing:

  • the run.sh script is probably inappropriate for daemons, please explain why you used it
  • the desktop apps don’t start because of missing shared library, consider adding it

I build the package on Ubuntu 16.04 and KDE Neon, everything in it works. I’m talking about the package for X11, with it I haven’t a problems. CORE and BTL095(app) works fine. Problem I have only with package for Mir.

There is no reason to use this script. If you think that it is not needed at all, then you could try without it?

And last ask, this command starts the CORE from you bsp095project.BSP095launcherCore and bsp095project.BSP095launcherCoreSimulation?