/srv/irclogs.ubuntu.com/2016/05/05/#snappy.txt

=== JanC is now known as Guest15498
=== JanC_ is now known as JanC
example6My snap is unable to create files inside its directory in /apps despite its directory having access to anyone. Is there some sort of method I should be following to give it its own directory in a more writable space?01:13
example6I changed ownership of it to root, that didn't seem to help. It seems to be root who's running my program01:16
example6Would this be something to do with apparmor?01:33
jdstrandexample6: /apps is readonly. you have to use the writable directory in /var. Since you said /apps, I'm going to assume you are on 15.04, therefore the writable directory is in /var/lib/apps. you can look at $SNAP_APP_DATA_PATH in your environment to see the precise directory to use01:41
jdstrandexample6: if you are actually on 16.04, the readonly directory is in /snap and the writable in /var/snap and you use $SNAP_DATA in your environment01:42
* jdstrand was just passing through01:42
jdstrandhope that helps! :)01:42
example6jdstrand: that helps a ton! Thank you! Do you have any advice on copying my program to /var/lib/apps after installation? it's basically a script that runs a program that creates a few files in the same directory01:47
example6I noticed some of the demos (which don't properly start as services most likely since I am indeed on 15.04) had things like var, lib, bin, etc in side their snap/ directory01:47
jdstrandexample6: you got me before I walked away :) I did something similar in my ufw snap (snappy install ufw.jdstrand). basically, you copy what you need over into /var/lib/apps from /apps. this can be done be a wrapper script that after the copy, runs the real script01:49
jdstrands/be a/by a/01:50
jdstrandexample6: though it might be easier to adjust that program to take an optional argument to output to $SNAP_APP_DATA_PATH01:51
jdstrand--outdir=$SNAP_APP_DATA_PATH (or similar)01:52
jdstrandok, really gotta run, good luck! :)01:52
example6thank you!01:52
liuxgI just tried snappy app calculator on Ubuntu 16.04.  However, I cannot find the app in the ubuntu store app. what is the problem for it? https://developer.ubuntu.com/en/desktop/get-started/02:34
=== chihchun is now known as chihchun_afk
=== chihchun_afk is now known as chihchun
swamican someone help me with a question on device tree/dtb/fdt on rpi2?06:49
=== chihchun is now known as chihchun_afk
=== chihchun_afk is now known as chihchun
liuxgI have tried to develop a snappy app for my desktop. every time, when the app is installed, a new version is installed. when I remove it, it only removes the recent one. now the directory is full of different version of the snap app. how can I remove the previous versions of the app. it occupies a lot of space.07:50
shuduokgunn: hi, i'm following the guide https://goo.gl/4nmG93 to build mir demo. but snapcraft-mir-client building output error like "[Errno 2] No such file or directory: '/home/shuduo/work/snappy/mir-07:55
shuduodemo/snapcraft-mir-client/parts/environment/build/snappy-qt5.conf'07:55
liuxghow to delete a snap on ubuntu 16.04?09:38
liuxgI have tried to use "sudo snapp remove app_name". however, it does not remove the previous versions of the snap apps installed on the system.09:38
zygasergiusens: I would love to have easy access to all debugging symbols10:11
zygaquick break while pulseaudio is building10:12
blackout24Trying to gain some knowledge on the different commands (snap and snappy). When I download an Snappy Ubuntu Core image and run it in KVM it has the snappy command, which seems to handle more than just the packaging (configures the bootloader). "snappy" has an update command, but on 16.04 there is only the "snap" command and it doesn't look like there is "snap update".11:00
blackout24What are the roles of these two applications?11:00
zygablackout24: snappy is the old command that is removed in 16 and 16.0411:02
blackout24ahh thanks11:03
zygablackout24: snap is the replacement that uses the REST api (snappy had everything linked in)11:03
zygablackout24: update is now called refresh11:03
blackout24When 16.04 downloads a new ubuntu-core snap will it mess with the bootloader? Because 16.04 isn't a snappy system.11:03
zygablackout24: no11:04
zygablackout24: snappy differentiates between core and classic systems11:05
blackout24I have ported snappy to Arch Linux and everything works, but when it downloads the ubuntu-core image when I try to install the calculator-app it complains that it can't determine the bootloader. How can I tell snap that I'm on a classic system and it should only install it as a framework.11:05
zygablackout24: ah, in that case you need to patch the source a little, in the past (2.0.2 release) we checked for dpkg status file, now there's a method (I need to check which) that checks this11:06
zygablackout24: I think it should be easy to tweak that to understand arch as well11:06
zygablackout24: I can help you out in a moment, just need a second to test something I'm hacking on now11:09
zygablackout24: look at release/ look for onClassic11:10
zygablackout24: I'm sure we will gladly take patches to detect arch there11:11
blackout24Right now I just pull the 2.0.2 snapd deb file from archive.ubuntu.com and "ar p *.deb data.tar.xz | tar -Jxf -C targetdir" the whole thing in a PKGBUILD. I could also let it build the latest Go sources from github and only extract the systemd unit files from snapd deb.11:11
zygablackout24: no that won't work, you really need to rebuild it with a patch11:11
zygait behaves differently on classic and on all-snap system11:11
blackout24ok11:11
zygablackout24: and get master11:11
zygablackout24: (no point in using 2.0.2) we SRU regularly so working on latest version is the best way11:12
* zyga back to hacking11:12
blackout24Great thanks. I also wanted to see if I can tweak snapcraft to use pyalpm to check if the build-tools and dependencys are installed on an Arch system.11:14
zygablackout24: for that look at sergiusens11:15
zygablackout24: I can help you out with snappy11:16
zygajdstrand: hey, I have some good and some bad news12:18
jdstrandzyga: hey12:20
jdstrandand here I was trying to sneak in early to get some stuff done...12:20
zygahehe12:20
zygajdstrand: I got pulseaudio on classic to work12:20
zygajdstrand: but this doesn't solve the bigger shm_open problem12:21
jdstrandwhat did you do to get pulseaudio on classic to work?12:22
zygajdstrand: http://paste.ubuntu.com/16236835/12:22
zygasurprisingly little12:22
zygano other changes required12:22
jdstrandok, yeah12:22
jdstrandthat is what I figured it would look like12:22
zygajdstrand: connect is in the base profile I think, I can remove it12:22
zygajdstrand: now what is interesting is how pulseaudio would work as a snap itself12:23
zygae.g. would it still be +owner /run/user/*/pulse/native rw,12:23
jdstrandright12:23
zyga(i doubt that)12:23
jdstrandthis is where I was talking about the dichotomy of classic vs core12:23
zygastill, I think this is better than nothing, I'll iterate to reject pulseaudio slots for now12:23
jdstrandand the policy being different12:23
zygaand propose this, it unlocks a lot of nice apps today12:24
zygaand we can add slot support later12:24
jdstrandzyga: this is exactly the policy I was thinking should be in either unity7 or unity7-(pulse?)audio, etc12:24
zygaI think it's fine to have a pulseaudio interface12:24
zygaas a dedicated thing12:25
jdstrandI think it is completely fine to have a pulseaudio interface12:25
jdstrandfor snaps12:25
jdstrandfor snapped pulseaudio12:25
zygawe just need to think if the actual interface is portable, I think the only issues is /run/user socket12:25
jdstrandI'm very less sure about this12:25
jdstrandthere's other stuff12:25
zygaif the socket was provided to the client as an attribute12:25
zygayes?12:25
jdstrandthere is a dbus socket iirc, something else12:25
jdstrandI can't recall everything. some are safe some are not12:26
zygaI'd start with one that just hands access to this socket12:26
zyganot to dbus (this app doesn't need dbus, it does sound like 90% of apps do)12:26
zygaI bet pulse has a rich interface but we don't have to support all the bells and whistles (e.g. one that would make the sound indaicator work)12:26
zygaindicator*12:26
jdstrandso this gets back to: are they separate interfaces (pulse for classic and pulse for core) or is it one named interface (pulseaudio) that will output different security policy if on a classic system vs core system12:27
zygaI think that different policy is okayt12:27
zygadifferent behavior is less okay (not okay)12:27
jdstrandI don't think we know that this will be for 90% of the apps12:27
zygaand this if we take a common subset and enforce that, a single interface is okay12:27
zygajdstrand: 90% of apps just play sound12:27
zyga10% also capture sound12:27
zyga0.1 need to manage pulseaudio internals12:27
zygaballpark numbers but that's realistic IMHO12:28
jdstranddid you know that 85% of statistics are made up on the spot?12:28
zygaexactly12:28
jdstrand:P12:28
zygaand mine fits12:28
jdstranddoes it?12:28
jdstrand:)12:28
zygalook at it from another point of view, all apps on all mobile devices can play sound when they run12:28
zygasupporting that today is very easy and I think that's what we should do12:28
zygasupporting more is an open question that we don't have to solve now12:28
jdstrandwe can take an opinionated view that to play sound you must use what is in the interface12:29
jdstrandbut every time we take an opinionated view on classic, there is pressure to just allow it12:29
zygaI see what you mean, I think we will need to experiment some more12:29
zygaperhaps the real issue is the interface name12:29
jdstrandzyga: we have an audio policy on Touch that does that safely12:29
zygaperhaps we should require that the plugs have an attribute "basic"12:29
zygaor something like that that lets us do more later12:30
zygais touch also using pulseaudio?12:30
jdstrandyes12:30
zygadoes it differ because of no X, I know pulse uses X for some IPC12:30
jdstrandwe call the policy group 'audio', but that is pulseaudio12:30
jdstrandI don't know anything about that12:30
zygawhere can I look at the policy?12:31
jdstrandperhaps that is one of the different optional IPC mechanisms (like the dbus one)12:31
jdstrandzyga: http://bazaar.launchpad.net/~ubuntu-security/apparmor-easyprof-ubuntu/1.3-stable-phone-overlay/view/head:/data/policygroups/ubuntu/1.0/audio12:32
zygathanks!12:33
niemeyerzyga: How does the pulse audio files look like under shm?12:35
jdstrandzyga: so, I don't particularly care if we use one interface name with two different policy or two interfaces names. I only care that the policy is appropriate on the target system. that said, once we make the decision, that's it, which is why I'm being cautious12:35
jdstrandand I don't have actual stats that the cli and dbus-socket (as opposed to native) aren't legitimately used on classic. on Touch we said "sorry, use 'native'". on classic, I worry someone is going to say "you need to make super important app FOO work and it needs 'cli'"12:36
jdstrandbut again, if we export two different policies depending on the running system, fine12:37
jdstrandit is just we don't have that device introspection in the interface code today12:37
jdstrandthough, one could argue that we are breaking our contract if when using 'pulseaudio' on classic you also get 'cli' where on core you don't12:38
sergiusensblackout24 so you want to use pyalm as build-packages/stage-packages? Look at snapcraft.internal.repo to start out12:39
jdstrandperhaps an attribute could help there... but I'm not sure what that would look like12:39
zyganiemeyer: pulse-shm-$random-number12:39
sergiusensgood morning12:39
jdstrandniemeyer: it would be much nicer for a pulse snap to use pulse-shm-snap.foo.$random-number (or similar)12:40
jdstrandthen we can have /dev/shm/pulse-shm-snap.@{SNAP}.* rwk,12:41
niemeyerjdstrand: How's that better than /dev/shm/${SNAP}.*?12:41
jdstrandthat would work too12:42
jdstrandI think that falls into (or similar)12:42
zyganiemeyer: I think the question we should be asking is if we should expect to patch applications in any way or not12:42
zyganiemeyer: if the answer is yes then we can have a nice policy and sensible values everywhere12:42
zyganiemeyer: if the answer is no, it's complicated12:42
jdstrandI betting the client doesn't need patching12:42
jdstrandI'm12:42
jdstrandbecause it is a random number12:42
niemeyerjdstrand: Hm?12:43
jdstrandit is probably talking on the native interface and the server says-- here, use this thing (whether by fd or something else)12:43
zygajdstrand: the server probably passes the filename via the socket12:43
jdstrandand so the client doesn't care what the file name is. I'm am guessing that is how it works12:43
zygajdstrand: though pulse is complex, I bet there are many options thre12:43
jdstrandzyga: yes, that is what I'm saying12:43
jdstrandso in theory, the pulse snap could be patched12:44
zygajdstrand: I was just highlighing the filename vs fd12:44
zygajdstrand: the other thing to note is the socket itself12:44
zygaas in where it is12:44
jdstrandwe could even SRU a patch so that classic does the same thing12:45
jdstrandperhaps the SRU would look at the security label of the connecting application and only do it for clients whose label starts with 'snap.'12:45
jdstrandanyhoo12:46
zygajdstrand: can apparmor/seccomp do something about connections over unix sockets?12:46
zygajdstrand: e.g. constrain connect12:46
jdstrandzyga: the socket itself is going to need to be known by the clients12:46
jdstrandyes12:46
davidcallesergiusens: kyrofa: developer.ubuntu.com is now syncing snapcraft docs with github every 2h \o/12:46
jdstrandwe have unix mediation12:46
jdstrandthough not for file backed sockets12:47
jdstrandthis is a named socket so we only have file rules12:47
zygaah12:47
zygaI see12:47
sergiusensdavidcalle \o/12:47
jdstrand(we'll get full unix mediation semantics for named sockets with future work)12:47
* sergiusens checks12:48
zygajdstrand: I was thinking about patching pulse server but then there are other apps, I don't know how the socket is located today, is that hardcoded somewhere or is that passed by IPC we don't see12:48
zygajdstrand: but perhaps that is not needed12:48
jdstrandzyga: I think this is like mir-- there is a known location and that's ok12:48
zygajdstrand: on classic the /run/users socket is okay12:48
zygajdstrand: on snappy we could just make a different policy12:48
zygajdstrand: on classic pulse runs as the user12:49
jdstrandon core I think we're going to need to let the permanent connected slot to need to use a well-known path12:49
zygajdstrand: so that's another complication12:49
jdstrandthat was a poorly contructed sentence12:49
zygajdstrand: at the end of the story we should check if a snap like paplay can work on classic and core12:49
jdstrandzyga: on Personal, it will run as the user too12:49
zygajdstrand: but perhaps not on core12:49
zygajdstrand: it couldn't today, right?12:49
niemeyerI'm honestly a bit lost on the conversation by now12:50
zygajdstrand: service == root12:50
jdstrandzyga: Personal is going to need a lot of work. that would be of session services12:50
zyganiemeyer: sorry, we're brainstorming what possiblities exist and what implications they might have now, this is specific to pulse, not to shm_open12:50
zygais there anyone working on pulseaudio snap for core today?12:51
niemeyerzyga: Understood, but I'm kind of missing the high-level conversation we should have12:52
jdstrandniemeyer: for the record, I'm completely fine with /dev/shm/${SNAP}.* as that keeps things isolated. if we feel this is a good thing generally, I can propse a change12:52
niemeyerzyga: What are the constraints for that design12:52
jdstrandniemeyer: that may not help pulse and chromium, but it provides a general 'do this and it will work' mechanism12:52
zygaI agree with jdstrand's opinion on this12:52
zygawe can always poke holes with specific interfaces, shouldn't stop us from sane defaults12:53
zyganot thet the very subtle path that jdstrand proposed does not have subdirectories under /dev/shm as that would not work12:53
jdstrandzyga: re who is working on it> no, but it is on the list from phonedations, after bluez, nm, location-service and ofono/modemmanager12:53
zygaundrstood12:53
jdstrandaccording to I believe, morphis12:53
zyganiemeyer: quick question, would you be okay with a pulseaudio interface that works on classic only (like x11,unity7) and allows just plugs (no slots)?12:54
niemeyerjdstrand: So what is pulse audio trying to do that this would not work?12:54
jdstrandzyga: I could allow creation of both a snap-specific file patch and a snap-specific directory in /dev/shm so people are free to use that general mechanism without issues12:54
zygajdstrand: except that shm_open rejects subdirectories12:55
zygajdstrand: we could allow it but it would  be non-trivial to use12:55
jdstrandniemeyer: pulseaudio server today does not conform to /dev/shm/${SNAP}.*12:55
jdstrandniemeyer: it could be made to do so both in a snap and in SRU12:55
niemeyerjdstrand: Ah, ok.. my underslying question was actually: do we know of cases that want to share those files?12:55
jdstrandzyga: right, which is why we allow *both*. one that is file for shm_open and one that is directory for people that use open()12:55
zygajdstrand: that would work12:56
jdstrandbut both are app-specific12:56
niemeyerjdstrand: app-specific or snap-specific?12:56
zyga2016 and mksquashfs freezes my desktop session because scheduling sucks :/12:56
jdstrandniemeyer: honestly, I do not. I was assuming they were client specific (not even session specific) since I see a bunch of them in my session12:56
ogra_Stop using that hardware from 200412:57
jdstrandzyga: hrmm-- I see similar things :\12:57
ogra_:)12:57
jdstrandogra_: I have an xps 13!12:57
jdstrandnot the newest one, but still :)12:57
ogra_The 2004 model ?12:58
sergiusensdavidcalle looks good, I have a request already though ;-) Can we enhance the code snippets with pygments?12:58
jdstrandhaha12:58
* ogra_ grins12:58
jdstrandno :)12:58
jdstrand2014 iirc12:58
ogra_yeah, same device here...12:58
davidcallesergiusens: only if markdown has a way to specify language for code snippets12:58
niemeyerzyga: What did you find out with pulseaudio?12:58
ogra_do we use xz for squashfs compression ?12:59
niemeyerzyga: When you allow it to use shm, but not other processes to see those files, what happened?12:59
davidcallesergiusens: (or we come up with a custom tag, that works too)12:59
jdstrandniemeyer, zyga: ok, so, do we agree that I should modify the default policy to allow /dev/shm/${SNAP}.* for files and directories just because that is the correct way to handle shm_open() and open(), regardless of pulse, chromium, etc?12:59
zyganiemeyer: that pulseaudio on classic can be accomodated with a very simple interface, it needs to access a shared socket (per user) and files named /dev/shm/pulse-shm-*12:59
zygajdstrand: +112:59
zygajdstrand: pulse would work with a simple interface as described13:00
niemeyerjdstrand, zyga: Let's consider that for a little while before acting, please13:00
zygajdstrand: chromium, I need to analyze still13:00
zygastandup!13:00
jdstrandniemeyer: all that is doing is saying: "the path we said you could use before (/dev/shm/snap/$SNAP/**) we undesrtand to be broken. here is something that will work for you. Next up, design pulseaudio interface (that may or may not comply with that)"13:01
sergiusensdavidcalle the github extension of markdown does fwiw (and we are using it or were)13:02
jdstrandzyga: for pulse, if we are saying "native socket only for both core and classic" and we generate policy for /dev/shm/pulse-shm-* on classic and (perhaps) /dev/shm/$SNAP... on core, then I'm ok with one interface: pulseaudio13:03
jdstrandzyga: if we are going to entertain the dbus or cli pulse sockets, those need to be different interfaces/attributes13:04
jdstrandthat way the default is always the native socket, but (if we decide to support it), you can request cli or dbus-socket13:04
jdstrandzyga: oh, and the native socket for the slot is at a well-known path13:05
jdstrandthough, I think I prefer /dev/shm/snap.$SNAP... to /dev/shm/$SNAP... for namespacing13:06
jdstrandwe could argue that point in the PR13:06
kyrofaGood morning13:07
kyrofadavidcalle, awesome!!13:07
davidcallesergiusens, ok13:09
jdstrandzyga: in this manner, the contract is always the same for the native socket. we just may (or may not) use a different shm path13:09
sergiusensdavidcalle hey, I love the fact that they are being updated though!!! \o/13:10
zygajdstrand: hmmm, I'm not sure I understand that correctly, would you mind expresisng that as a plug-side aa policy pseudo code?13:11
zygajdstrand: I agree on /dev/shm/snap.$SNAP13:14
zygajdstrand: $SNAP_NAME to be precise13:14
jdstrandzyga: if we say that the 'pulseaudio' interface uses 'native' socket by default, plug side for classic is what you pasted. plug side for core may drop /dev/shm/pulse-... and rely on only the general /dev/shm/snap.$SNAP (I say may cause let's see how things go with that snap). then, if at some future date someone wants the 'cli' or 'dbus-socket' pulseaudio sockets, we introduce an attribute or pulseaudio-{cli,dbus-socket} interfaces13:15
zygajdstrand: I agree with that13:15
jdstrandzyga: in this manner, the default pulseaudio interface contract is consistent between classic and snap13:16
jdstrandwhich was my biggest concern13:16
zygajdstrand: yes, that's very important13:16
kgunnshuduo: ah...thanks for the catch, i forgot to bzr add that file....added now, should work13:16
zygajdstrand: and later on we can do pulseaudo-control interface or use attributes, depending on how things look like precisely13:16
jdstrandso if we're pressured to allow cli or whatever, we have a way forward that doesn't break apps (new interface or attribute)13:16
jdstrandexactly13:16
jdstrandok, cool13:16
jdstrandI think we are in agreement on pulseaudio. I'd like to get to agreement on the paths in /dev/shm for the non-pulseaudio general case too though13:17
jdstrandsince they are known to be broken13:17
jdstrandthen we can look at chromium13:17
jdstrandoh13:17
zygajdstrand: I think /dev/shm/snap.$SNAP_NAME.*13:18
zygajdstrand: snap. as that makes it obvious what the culprit is13:18
zygajdstrand: no .app as shm is an IPC mechanism and shold work within one snap directly13:18
zygajdstrand: and .* to allow those random names13:18
zyga(to be precise . to termiante $SNAP_NAME * for the random stuff)13:19
jdstrandzyga: we talked a long time ago about the 'home-hidden' interface but I think that morphed into (the idea to have) an interface that allows requesting access to file/directory (eg, ~/.mozilla). that could be used for chromium13:19
jdstrandzyga: snap.> yes and makes sure a crafted snap name doesn't try to use a well-known path in /dev/shm13:19
zygajdstrand: and we could also marry this with a patch to glibc13:20
jdstrandzyga: the whole time I was thinking snap.$SNAP_NAME.* since I figured apps within a snap might want to use shm however they want13:20
zygajdstrand: to make shm_open() use $SNAP_NAME prefix transparently if SNAP_NAME is defined13:21
zygajdstrand: _or_ let people use something like my runtime helper13:21
jdstrandthat is a possibility13:21
zygajdstrand: LD_PRELOAD or linked in13:21
jdstrandor they patch the code13:21
jdstrandyes, there are options for people13:21
zygamy helper is actually a nice bit that you can link in or preload and it just works :)13:21
jdstrandyeha13:21
jdstrandyeah13:22
jdstrandI guess that would be part of snapcraft?13:22
jdstrandyou say, "I want snappy compliant paths in /dev/shm' in snapcraft.yaml and you get that?13:22
jdstrandthat doesn't help static code, but that's ok. it is handy regardless13:23
zygajdstrand: we can make that happen by magic with snapcraft13:23
zygajdstrand: just stick it in13:23
zygajdstrand: oooor13:23
zygajdstrand: actually I have a interesting/cool idea13:23
zygajdstrand: what if we had a magic LD_PRELOAD managed by the core snap itself13:24
zygajdstrand: where we ship very conservative and non-invasive things like that13:24
zygajdstrand: so when policy changes, it still works13:24
jdstrandthat is an interesting idea. my conservatism says we may want to offer an opt-out though13:25
zygasure13:25
zygaout is okay13:25
zygajdstrand: offtopic, are you going to the sprint?13:26
jdstrandzyga: what did you think about the comment on the 'path interface' bit for chromium (which uses open()). is that 'path interface' still a thing? (I thought it was needed for things like ~/.mozilla, etc)13:27
jdstrandzyga: no. tyhicks will be there. I will be on irc though in my normal timezone13:27
zygathe path interface is an interesting idea, it's certainly a sprint topic, I was thinking about it from a different POV, .e.g. where you as a user can create a slice of $HOME, create a new slot, and connect it to some slots (typed home-slice perhaps)13:28
zygajdstrand: how that might work for non-home directories, I don't know13:28
jdstrandzyga: so the spec for that interface is only for non-home?13:29
jdstranderr13:29
jdstrandonly for home?13:29
zygathere's no spec yet, this was just some speculation13:29
jdstrandok13:29
zygajdstrand: I'd like to have one13:29
zygajdstrand: it's a simple idea and would let us see how hooks work (it would have to be hook based)13:30
jdstrandyeah. my understanding is that it is a requirement13:30
zygajdstrand: ok, let's wrap up shm_open and pulseaudio as agreed13:30
zygajdstrand: I'll work on pulse now13:30
zygajdstrand: I have a lovely snap that just work with this interface, I'd love to put it in the store13:30
jdstrandzyga: I can work on the generalized shm13:30
zygajdstrand: brilliant, thank you13:31
jdstrandzyga: so, I have two simple PRs from yesterday but the intergration tests failed. I don't see how my code could have done that (especially the PR for doc changes :), but I can't see the integration test results to know what is happening13:32
zygajdstrand: integration tests are broken now I think13:33
zygafgimenez: ^^ are they?13:33
zygajdstrand: if you connect to the VPN you can see the results13:33
zygajdstrand: let's merge the doc changes after they get the second review13:34
zygajdstrand: as for the other PR, I didn't review any yet13:34
jdstrandack, thanks13:39
jdstrandzyga: for me at least, this pulseaudio discussion was really good. it solidifies concepts like interfaces contracts, classic vs core vs personal, how attributes might play a part, etc13:40
jdstrandwhich will inform future interface discussions13:40
jdstrandyes, FileNotFoundError in the jenkins output. seem broken13:42
blackout24zyga, I changed the release.go code: https://github.com/timjp87/snappy/blob/master/release/release.go#L7313:49
blackout24Unfortunately I still get "Make snap "ubuntu-core" available to the system (can not set next boot: cannot determine bootloader)"13:49
zygablackout24: you also need to patch ubuntu-core-launcher13:49
blackout24ahhh13:49
zygablackout24: though wait, where do you see that error?13:49
zygablackout24: on snapd start up? snap install? when?13:49
blackout24snapd install13:50
blackout24I try to install the calculator13:50
blackout24and it first fetches ubuntu-core13:50
blackout24I cleaned my previous installation, which just used the precompiled 2.0.2 binaries from xenial and modified my PKGBUILD so that it pulls the source from github and applies the patch before building snap and snapd.13:51
blackout24I also rebooted to make sure13:51
zygablackout24: and the error showed up when?13:52
zygablackout24: note that snapd also has a few systemd units you need13:52
zygablackout24: you may want to look at those13:52
zygablackout24: but I don't know arch really so I cannot help there13:52
kgunnshuduo: so it worked ok for you now?13:53
zygasergiusens: could snapcraft be very conservative about .debs it downloads so snapcraft clean; snapcraft can reuse them, I still have to do snapcraft clean all the time and downloading debs over and over is the last big slowdown13:53
niemeyerblackout24: Please note we'd be happy to take those patches in13:53
niemeyerblackout24: Assuming you can make it all actually work13:54
blackout24Thanks. Yes I installed the systemd units from the github.com repo into /usr/lib/systemd/system. Arch has everything in /usr instead of installing stuff to /lib.13:54
blackout24They are the same that are listed as contents of the snapd package in 16.0413:55
zygablackout24: you will also need apparmor and seccomp13:55
zygablackout24: and ubuntu-core-launcher actually working13:55
shuduokgunn: i'm verifying on another laptop. will let me you later. maybe after 30 minutes. thanks. :)13:55
blackout24That's what I wanted to find out if apparmor is a hard dependency13:55
kgunnnw, thanks for trying13:55
zygablackout24: yes13:55
zygablackout24: and seccomp as well13:55
zygabut that's hard not to have :)13:55
zygablackout24: if you build ubuntu-core-launcher you're 90% closer to running snapd13:56
blackout24zyga: There is an alternative kernel available with the apparmor patches. It's not maintained but should be possible to revive.13:56
zygablackout24: you may also need kernel patches but I'll delegate that to some other folks13:56
kgunnzyga: you seem busy, but had a chance to try my fork and get the plug to connect?13:56
sergiusenszyga do snapcraft clean --step build13:56
zygasergiusens: <3 thank you13:56
zygakgunn: not yet, I'll do it today as I'm not going to be involved in UOS as much13:57
kgunnnw13:57
blackout24Right now I only have the userland apparmor libraries installed. They are available through the AUR.13:57
sergiusenszyga also, you can most likely get away by using build packages instead of stage-packages in most cases13:57
niemeyerjdstrand: How fast can we ship a new glibc for 16.04?13:57
sergiusensblackout24 the ubuntu security team has some easy instructions to get different kernel versions patched13:58
zygakgunn: how does mir use shared memory?13:59
sergiusensblackout24 maybe this can kickstart your work https://wiki.ubuntu.com/SecurityTeam/AppArmorForPhabletKernels13:59
sergiusenszyga heh, the shm question is being raised a lot now. I am happy to see this being brought up :-)13:59
zygasnappy will comb software into looking nice and uniform14:00
* zyga does a poor man's job of snap try14:01
blackout24sergiusens, thanks14:01
zygaand ... wow, speedup :)14:01
jdstrandniemeyer: the new glibc for shm_open?14:01
niemeyerjdstrand: Yeah14:01
zyganiemeyer: to make shm_open() understand $SNAP_NAME and use it as prefix?14:03
jdstrandwell, the hardest part would be convincing infinity, but I'm kinda liking zyga's LD_PRELOAD idea since that would work on any glibc system (eg, non-Ubuntu systems)14:04
zygajdstrand: I'll refresh my preload library to do that14:04
zygajdstrand: we can experiment with it while convincing infinity :)14:05
jdstrandzyga: well, but again, if we use your LD_PRELOAD library be default idea, there is no need to convince infinity. snappy can maintain those changes outside of SRUs and those changes propagate to other distros14:06
jdstrands/be/by/14:06
zygahmmm14:06
zyganot needing it would feel nicer but I agree that it is a simplification14:06
jdstrandI can promise you upstream glibc won't take it, so then we have a permanent delta that we ask all other distros to incorporate14:06
zygaiff it is added by default by snapcraft14:06
zygajdstrand: why won't they take it?14:07
jdstrandsnapcraft or your snapd idea of by default14:07
zygaah, right14:07
camakozyga, @how mir uses shared memory : It uses it for Mesa s/w clients. Mir client requests it, server allocates it, client renders to it, gives it back to the server, and server posts it on the display14:07
jdstrandhave you worked with upstream glibc?14:07
jdstrand:)14:07
zygajdstrand: no :)14:07
jdstrandgo ahead, float this by infinity right now in #ubuntu-devel :)14:07
zygacamako: I'd like to know how it allocates shared memory and shares is across processes14:08
zygajdstrand: isn't that guy who used to be grumpy off glibc maintenance now :)14:08
jdstrandbut really, again, regardless of upstream, having this (and perhaps other things) in control of snapd/snapcraft might be better14:08
zygajdstrand: yes, I agree on that14:08
jdstrandzyga: yes... :)14:08
zygajdstrand: looking at how shm_open works, it's actually a bit sucky :/ it's easy to hack and change the directory, harder to convince glibc to just take a non-directory prefix...14:09
zygagimme a sec14:09
* sergiusens starts monitoring #ubuntu-devel with a bucket full of popcorn14:10
fgimenezzyga, integration tests infra seem to be fine now14:11
zygafgimenez: thank you14:11
camakozyga, it allocates using14:13
camako    auto raw_fd = open("/dev/shm", O_TMPFILE | O_RDWR | O_EXCL | O_CLOEXEC, S_IRWXU);14:13
camakoit maps using mmap14:14
camakozyga, it requires a kernel that supports O_TMPFILE14:15
zygacamako: thank you14:15
camakoyw14:15
zygajdstrand: ^^14:15
kgunncamako: is same for android bins ?14:15
zygajdstrand: that looks like not something glibc can "cure"14:15
kgunnvs mesa14:15
camakokgunn, not today but it could be14:16
zygakgunn: who's doing the allocation? mir-server or mir-client?14:16
camakoused for android in the future as well14:16
camakozyga, mir server does the allocation14:16
zygacamako: ahhh, even more interesting14:17
fgimenezzyga, np :)14:17
camakozyga, though also in the future we could use client allocated buffers as well... not today tho14:17
zygacamako: how does it share this with the client?14:17
kgunncamako: isn't server alloc'd buffs part of our security story tho14:17
camakothrough an IPC mechanism that dups the fd14:17
camakozyga ^14:17
zygacamako: so the client side just gets the fd and mmaps it14:18
camakokgunn, yeah there may be issues... that's why it's not done yet14:18
zygacamako: no need for an open on the client side?14:18
camakozyga, correct14:18
zygathanks14:18
zygathat's good and bad14:18
zygathe O_TMPFILE is something hard for us to support14:18
zygaI need to read how it works14:18
camakozyga, there is nothing magical about it, just that it was introduced in kernel > 3.1814:19
camakozyga, we also have an alternate path for lesser kernels that uses " raw_fd = mkostemp(template_filename, O_CLOEXEC);"14:20
jdstrandzyga: fyi, there is a list of required kernel patches that ogasawara and others are putting together for snappy kernels14:20
zygajdstrand, camako: it's not really as much as an old kernel, we just want to ensure snaps cannot create arbitrary names in /dev/shm14:21
camakozyga, but that leaves a temp file that we have to unlink. O_TMPFILE doesnt create anything in the filesystem14:21
zygawe'd prefer if they can be prefixed14:21
zygaoh14:21
zygaso there's no file at all? a14:21
zygaso that might just work (tm)14:21
camakozyga, correct14:21
zygathanks!14:21
zygathat's much easier to support :)14:21
jdstrandwell14:21
jdstrandthere is probably an LSM hook for it14:21
jdstrandand that is probably going to be mediated as a file14:22
jdstrandI would ask ty hicks about that, but he is currently working on an emergency14:22
jdstrandmaybe there isn't a hook (idk)14:23
jdstrandit's easy to see though14:24
jdstrandif you have a new kernel just try the code and see if it gets blocked14:24
zygajdstrand: if we cannot confine it, is that a problem?14:25
zygajdstrand: remember that we still confine the socket that is used to transport the fd14:25
swamican someone help on dtb/fdt/device tree issue on rpi2 with custom u-boot?14:25
jdstrandzyga: if there is no denial and no path then there should be no attack vector since another application shouldn't be able to get at the fd. this would also need ty hicks input14:27
zygakgunn: I'll look at mir next, wrapping up this work14:27
kgunnsure14:28
swamiduring u-boot, after loading uboot.env, I m getting this error: "libfdt fdt_check_header(): FDT_ERR_BADMAGIC No FDT memory address configured. Please configure the FDT address via "fdt addr <address>" command. Aborting!"14:31
swamibut the printenv show fdt addr and file etc., any pointers, anyone please?14:31
kgunnjust from another thread and discussion, and sorry if i missed this if already said, but is there a thought to make interfaces have versions?14:32
kgunnor should that be frozen per series at least?14:32
kgunnzyga: niemeyer ^14:32
zygakgunn: interface is like a binary protocol14:32
zygakgunn: if you change it in an incompatible way14:32
zygakgunn: it should be a new interface14:33
kgunnok14:33
kgunnpmcgowan: ^14:33
zygakgunn: what is the current trend? is it constantly a new wire protocol?14:34
pmcgowankgunn, so yes ;)14:34
zygakgunn: another option would be to constrain the interface to a library and have the "mir client" share a .so for the other snap to open14:35
zygakgunn: then the wire is irrelevant-ish14:35
kgunnzyga: i was wondering only in the context of sdk/uitk actually (brainstorming if interfaces would be used there)14:35
pmcgowankgunn, I think the big difference vs what we do today is we cannot have one snap provide multiple interfaces14:35
pmcgowanwhereas today one pile of bits is many frameworks14:36
kgunnright14:36
pmcgowanwhich is the potential issue depending on your viewpoint14:36
zygakgunn: definitely, the only question is how, not if14:36
kgunn;)14:36
niemeyerkgunn, zyga: Using a library just moves the same problem elsewhere14:36
niemeyerYou now have a library ABI and the interface must change if that ABI breaks14:37
zyganiemeyer: yes that is true, just the question of which problem is easier to solve14:37
niemeyerzyga: Different answers for different developers14:37
niemeyerpmcgowan: Why can we not have one snap providing multiple interfaces?14:38
pmcgowanniemeyer, can we?14:38
zygayes :)14:38
niemeyerpmcgowan: Yeah, multiple plugs, multiple slots14:38
pmcgowanah then great14:39
kgunnso you can effectively version (meta-like)14:39
niemeyerpmcgowan: With the same interface or different interfaces14:39
niemeyerkgunn: We have unity7 today already14:39
niemeyerkgunn: We just don't have a field named "version" in the interface, and I don't think we should do that14:39
kgunnsure14:39
niemeyerWe should try really hard not to break these interfaces, as it means we're breaking real software out there every time we do it14:39
pmcgowanindeed14:40
niemeyerWhen we do require the breakage, we need a new interface14:40
niemeyerA new interface is simply a new name from the user perspective, with a new definition from snapd's perspective14:40
kgunnright, it's just a reality with SDK...it will need to evolve/grow over time14:40
niemeyerkgunn: Of course, it's a matter of how long we stick to an interface, not whether we should break it or no14:40
niemeyerkgunn: Good software tends to be engineered so that its public runtime APIs do not break often14:42
niemeyerkgunn: The longer they last, the longer software remains working, the better for everybody14:42
kgunnniemeyer: sure, and i think pmcgowan's team doesn't change a crazy amount...but just needs a way to manage the breaks14:42
kgunnand seems like that's a decent answer14:42
pmcgowankgunn, niemeyer what we do a lot of is add new APIs without breaking old ones14:42
niemeyerI'm not judging anyone.. this is a statement of desire :)14:42
pmcgowanso that sounds like multiple interfaces14:43
niemeyerpmcgowan: Depends..14:43
kgunnpmcgowan: and even if you do break...you could run through a series with interface-old and interface-new, then drop -old in the next series14:43
niemeyerpmcgowan: Sometimes it's possible to introduce new features without breaking old logic and in a way that is introspectable14:45
pmcgowantrue14:46
shuduokgunn: mir-demo works great now. thanks.14:49
zygajdstrand: https://github.com/ubuntu-core/snappy/pull/113314:50
zygajdstrand: also https://myapps.developer.ubuntu.com/dev/click-apps/4989/rev/1/ ;)14:51
zygajdstrand: if you want to try this out14:51
jdstrandack14:52
zzarrhello!15:26
zzarrI'm new to snappy15:26
zzarrhow does it work?15:27
zzarrI have a dragonboard 410c which I have booted snappy from a sdcard on15:27
zzarrI wish to install it to the emmc on the dragonboard, but I don't know how15:28
zygare, sorry, system crashed hard when I unpluged an USB device :/15:30
zygajdstrand: I read your comment and I fully agree15:35
zygajdstrand: thanks for teaching me more about apparmor details through the various comments :)15:35
zygajdstrand: do you think SRU-ing pulseaudio is something we should get started with now (to restrict recording)15:35
zygajdstrand: so that it can be ready when the next snappy SRU is out15:35
jdstrandzyga: I do, yes15:35
jdstrandzyga: that way they can just use pulseaudio playback and enjoy15:36
tyhickszyga: did you get all of your answers regarding O_TMPFILE?15:36
zygatyhicks: no, sorry, I got disconnected15:43
tyhickszyga: what did you want to know about it?15:43
zygatyhicks: hi btw :-)15:44
tyhickszyga: hi :)15:44
zygatyhicks: I think I just need to check now, I wasn't sure how O_TMPFILE worked, I heard that it doesn't even create an entry in the filesystem, just returns an fd15:44
tyhickszyga: that's correct15:44
zygatyhicks: does that mean the path argument is totally ignored?15:45
tyhickszyga: from userspace's perspective, yes15:45
tyhickszyga: the kernel uses the path to determine which filesystem's tmpfile() implementation should be used15:45
zygatyhicks: from the kernel? will you get an apparmor deny if the process cannot write to /dev/shm15:45
zygaah15:46
* zyga intends to experiment with mir next so he'll find out for sure :)15:47
jdstrandtyhicks: I wasn't sure apparmor would still mediate it as a path and if it didn't, is it possible for another process to get access to that fd?15:47
jdstrandtyhicks: sounds like zyga will blackbox the first question though :)15:48
zygahehe15:48
tyhicksjdstrand: other processes can't get to that fd (unless the owning process passes the fd to another process)15:48
tyhicksI'll take a quick look to see if AA is going to mediate it15:49
tyhickszyga: my biggest concerns about its usage are that it is only available in relatively new kernels and that not all filesystems support it15:50
zygatyhicks: that's upstream problem to solve (mir) but from what I read above there is a fallback to another mechanism as well15:51
tyhickszyga: aha! I was thinking that you were investigating its use in the launcher or something else internal to ubuntu core15:53
jdstrandtyhicks: right, that was my understanding (barring a kernel vulnerability of course)15:55
tyhicksjdstrand: the owning process can do some trickery in /proc/self/fd/ to link the fd back into the filesystem but AA mediation definitely comes into play at that time15:56
jdstrandtyhicks: so, if the server opened it and passed it to the client, are you saying the client can't pass it again? I thought it could (but that would trigger remediation)15:56
jdstrandrevalidation*15:56
tyhicksjdstrand: I didn't intend to say that15:57
jdstrand(and this is just for clarification-- whether it can't pass or can pass with revalidation is fine from an isolation perspective)15:57
tyhicksjdstrand: it is just a regular fd and it can be passed around like any other fd15:57
jdstrandok15:57
jdstrandthe point is, if I have an fd, nothing can access it unless I give it to them15:58
tyhickscorrect15:58
jdstrandcool, that is what I thought be wanted to be doubly sure :)15:58
plarselopio: fgimenez: Hi! I have the snap I build with your upstream tests pretty much up and running under checkbox now, but I hit a kernel bug yesterday on one of the tests, have you seen this? http://paste.ubuntu.com/16227643/16:03
zygaok, let's look at mir now16:05
tyhickszyga, jdstrand: I just did a quick test and you do need appropriate permissions in the directory that you pass to open() when using O_TMPFILE16:09
zygatyhicks: which level of permissions?16:09
zygatyhicks: apparmor or filesystem16:09
tyhickszyga: regular fileystem level permissions and apparmor16:09
tyhickszyga: they're both checked16:10
zygatyhicks: hmm, that's a bit annoying then, you need write permission for /dev/shm (apparmor) then?16:10
tyhickszyga: yep16:10
zygatyhicks: that's interesting/annoying then:) so mir slot will need "/dev/shm w,"16:11
zygaright?16:11
tyhickszyga: that's correct if they're passing O_WRONLY to open()16:12
tyhickszyga: if they're passing O_RDWR, then "/dev/shm rw," will be needed16:12
zygatyhicks: I believe the actual call is...16:12
fgimenezhey plars, nope, never saw that before16:12
plarsfgimenez: maybe a fluke, but I wanted to capture what I could16:12
zygatyhicks: camako:     auto raw_fd = open("/dev/shm", O_TMPFILE | O_RDWR | O_EXCL | O_CLOEXEC, S_IRWXU);16:14
zygaso /dev/shm rw,16:14
fgimenezplars, yes, that concrete test is passing in the cloud instances with that same kernel snap version http://162.213.35.179:8080/job/github-snappy-integration-tests-cloud/2309/consoleFull16:14
tyhickszyga: actually, looking at the kernel code, only write perms are checked even if O_RDWR is specified16:14
tyhicksthat's kind of odd16:14
zygatyhicks: in which way?16:15
tyhickszyga: just that they're only checking for write perms in do_tmpfile()16:15
zygaah16:15
zygaI though you meant the userspace code16:15
tyhickszyga: anyways, be sure to double check my work and leave those rules out of the interface initially to see if it gets a denial16:16
zygatyhicks: yep, that's sensible16:16
zygatyhicks: which work do you refer to?16:16
zygaI only read your seccomp argument filtering patches16:16
tyhickszyga: I was talking about my investigation into how O_TMPFILE is mediated16:17
zygaah16:17
tyhickszyga: double check it by leaving the rule out initially and see if you get a denial that looks like this:16:17
zygasorry, I'm not parsing stuff correctly today :)16:17
tyhicksapparmor="DENIED" operation="open" profile="test" name="/tmp/#23739838" pid=12721 comm="test" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=100016:17
zygayep16:17
zygaI'll do that16:17
zygajust setting up the environment now16:17
tyhickszyga: note the name="/tmp/#23739838" part16:17
tyhickszyga: I pass "/tmp" to open()16:18
zygathat #123 is not a real name right?16:18
tyhicksright16:18
zygais that userspace or kernel making that16:18
tyhickskernel16:18
zygaok16:18
tyhicksok, I need to tend to something else16:18
tyhickslet me know if you hit any issues16:18
zygathanks for your help!16:18
zygakgunn: ok, focusing on mir now16:18
zygakgunn: is your pull request up to date?16:19
kgunnzyga: only have a fork, didn't do a pull request...but yes, it was sort of "best state"16:19
zygakgunn: thanks, I'll take it :)16:19
kgunni played around with moving from perma slot to connected slot...but still had no joy16:20
zygakgunn: I think you shared the mir snap but do you have the link handy anywhere?16:20
kgunni was trying to connect manually like snap connect mir-server:mir ubuntu-core:mir...16:20
kgunnzyga: https://code.launchpad.net/~mir-team/+junk/mir-server-snap16:20
kgunnand a wiki for all the other stuff16:21
kgunnhttps://developer.ubuntu.com/en/snappy/guides/mir-snaps/16:21
blackout24If I use the current Arch Linux Kernel 4.5.1 as a template is it enough to just just flip some Kconfig switches to get apparmor and seccomp? The wiki here https://wiki.ubuntu.com/SecurityTeam/AppArmorForPhabletKernels mostly seems to be for old kernels. This would make packaging a custom kernel a lot easier.16:45
blackout24I have the apparmor parser and libs and libseccomp packaged as well as ubuntu-core-launcher.16:45
blackout24Only the kernel should be missing.16:45
zygablackout24: try it16:54
jdstrandzyga: fyi, https://github.com/ubuntu-core/snappy/pull/113517:05
zygammm17:05
zygajust a sanity check, w there lets the snap mkdir /dev/shm/snap.foo.$anything//17:06
zyga?17:06
jdstrandyep17:07
jdstrandI tested it17:07
zygafantastic, thank you17:08
jdstrandhttp://paste.ubuntu.com/16242478/17:08
jdstrand(that is within hello-world.sh)17:08
zygahello world is a very useful tool :)17:08
jdstrandit is :)17:08
zygaI'll upload busybox snap ot the store17:09
zygait's nice too and sometimes more powerful17:09
kyrofablackout24, yeah it really depends on the current kernel config. The 96boards kernel only needed squashfs enabled: http://blog.sergiusens.org/posts/Snapcrafting-a-kernel/17:11
kyrofazyga, where are we on some sort of hw-assign functionality with interfaces?17:14
zygakyrofa: it's there but nothing is using it17:14
zygakyrofa: an interface can hand out snippets of udev rules17:14
zygakyrofa: note that hw-assign is not coming back17:14
zygakyrofa: the assignable thing thould be a slot and a proper interface17:15
zygakyrofa: what do you need to support?17:15
kyrofazyga, right17:15
kyrofazyga, the realsense camera17:15
zygakyrofa: how is that exposed by the kernel?17:16
zygakyrofa: note that it smells very much like something that won't happen before we have hooks17:16
zygakyrofa: e.g. run hook to find realsense cameras17:16
kyrofazyga, uvcvideo17:16
zygakyrofa: you can prototype with an interface that tags a specific device along with an apparmor rule that lets it through17:17
zygakyrofa: how does the app find it?17:17
zygakyrofa: is it hard-coded/17:17
zygakyrofa: are you going to the sprint next week?17:18
zygakyrofa: we could hack this together quickly17:18
kyrofaYeah I am-- that'd be fun!17:21
kyrofazyga, no, not hard-coded... it uses the kernel module somehow. Not too familiar with the lib, but I'll do some research17:21
zygakyrofa: a strace of what it does is a good first step17:21
blackout24Setting CONFIG_AUDIT and enabling Apparmor Kconfigs worked. apparmor status gives me: "apparmor module is loaded." seccomp support was enabled anyway. Still getting "Make snap "ubuntu-core" available to the system (can not set next boot: cannot determine bootloader)", though. Might have to do some print debugging to see if it sets the OnClassic variable correctly.17:41
blackout24ubuntu-core-launcher is installed, too. Compiled it natively against libseccomp and libapparmor, which both also compiled natively and packaged.17:41
blackout24I also added also the extra files that are present in the ubuntu packages that go to /etc etc.17:42
ali1234kyrofa: was it you doing the "how to snap" demo yesterday?17:45
kyrofaali1234, I was one of them, yes17:46
ali1234the main one? the qt application?17:46
kyrofaali1234, yeah, the qt app. The bearded one :)17:46
ali1234answered many of my questions, thanks17:46
kyrofaali1234, I'm happy to hear that!17:47
ali1234had to drop out after your bit and missed the others17:47
ali1234when is a good time to ask some follow up questions?17:47
kyrofaali1234, now is fine17:47
ali1234hmm okay... so regarding install rules etc17:48
ali1234what does the layout inside the snap look like, to the application that is running?17:48
ali1234like if my file needs /etc/foo.conf, where does that go inside the snap? or how do i adjust the paths in my code?17:48
ali1234or say, /usr/share/myapp/somedatafile17:50
kyrofaali1234, the layout of the snap doesn't look any different to an app in the snap than it does to you outside the snap17:52
kyrofaali1234, i.e. /etc/foo.conf will try to reach out to /etc/foo.conf rather than the one in the snap17:52
kyrofaali1234, for that particular example, your app should use the $SNAP environment variable to make sure it's grabbing stuff within the snap17:53
ali1234so... how do i access datafiles that are staged and end up in the snap?17:53
kyrofaali1234, do you remember when I installed the snap and a script was generated by snappy and placed in /snap/bin/ ?17:53
kyrofaali1234, that script defines several environment variables that can be used by the application within the snap17:54
kyrofa$SNAP is one of them, which points back to the snap itself17:54
ali1234and if upstream doesn't use it, then i have to patch it?17:54
kyrofaali1234, well, that depends17:55
kyrofaali1234, to give you an example from my experience, I was snapping software from upstream which by default uses /etc/my-configuration-file.conf17:55
kyrofaali1234, however, that piece of software also had a command-line option for specifying the location of that file17:55
ali1234ah.. so then the wrapper can handle it17:56
kyrofaali1234, so all I had to do when snapping it was specify that flag in the `apps` section of my snapcraft.yaml17:56
kyrofaRight17:56
ali1234neat17:56
kyrofaali1234, but if your upstream doesn't have that type of functionality, things get more difficult17:56
ali1234okay next question. you talked about wiki parts... how can i see a list of them all and what they do?17:57
kyrofaali1234, in that case you either maintain a fork that uses $SNAP and friends, or perhaps try to contribute such a flag upstream17:57
kyrofaAh, easy!17:57
kyrofaI shared this link during the talk: https://wiki.ubuntu.com/Snappy/Parts17:57
kyrofaYou can see how each one is a little snapcraft snippet17:57
ali1234yeah.17:58
ali1234there's fewer than i expected :)17:58
kyrofaali1234, add some! ;)17:58
ali1234a gstreamer one would be nice17:58
ali1234...but17:58
ali1234what i really need is the broadcom videocore libraries17:59
ali1234that will probably be harder... they normally live in /opt/vc17:59
kyrofaYeah I'm afraid I have no experience with those17:59
ali1234i don't think they are even packaged in a deb anywhere18:01
kyrofablackout24, I get that error on a livecd session... you're not doing that by any chance?18:02
ali1234kyrofa: okay another question. i noticed you can specify build dependencies inside parts and also outside parts... why is that?18:03
ali1234presumably it also works for stage packages?18:03
kyrofaali1234, honestly I'm not quite sure-- there's really no difference18:03
kyrofaali1234, no, stage packages are different18:03
kyrofaali1234, build-packages aren't really part-specific, since they get installed on the host system18:04
ali1234hmm18:04
kyrofaali1234, whereas stage-packages become associated with the part in question18:04
ali1234i thought it would build everything in a chroot or something18:04
kyrofaali1234, no, unless you use cleanbuild which does it in an lxc18:04
ali1234ah okay. so i should probably do that to make sure i didn''t forget about any build deps which i already had installed and forgot to add to the yaml?18:05
kyrofaali1234, indeed, it would certainly catch those18:06
blackout24kyrofa, no I ported snapd to Arch Linux. The OnClassic boolean is correctly set to true in release/release.go. I patched it to detect Arch and it works when I fmt.Println() it.18:06
kyrofablackout24, haha, sweet18:07
blackout24I'm using systemd-boot as bootloader, but I thought that with OnClassic as true it would just skip the bootloader check18:07
qengho"redhat", huh.18:07
ali1234kyrofa: http://paste.ubuntu.com/16220152/ is what i got before i ran into the lack of vc libs, is there anything obviously wrong with that so far?18:07
sergiusensjdstrand hey, one thing I see about chrome is that it deletes the shm file "code-oss 8001 sergiusens   28u      REG               0,21  4198400      46 /dev/shm/.org.chromium.Chromium.XElnLe (deleted)"18:07
kyrofaali1234, no that looks pretty good actually18:08
kyrofaali1234, however, once you get this working as you expect note that you might very well be able to do away with those stage packages18:08
kyrofaali1234, do you remember when I was talking about the automatic library crawling?18:08
ali1234yes, didn't know about that (i wrote this a couple of weeks ago)18:08
kyrofaali1234, ah, okay. So that _should_ mean you don't need library-only stage packages18:09
kyrofaali1234, but it's still fairly new18:09
ali1234gstreamer does dynamic load plugins at run time...18:09
ali1234and the camsrc part is actually a gstreamer plugin18:09
kyrofaali1234, ah, you may need them then18:09
kyrofaGood catch18:09
kyrofaYou were listening!18:10
ali1234as well as the good/bad/ugly18:10
ali1234okay i think that's all my questions, thanks18:11
ali1234just need to solve this videocore stuff and i think i can handle the rest18:11
kyrofaali1234, you know where we are if you have more questions!18:12
pedronisblackout24: no, there's a buglet such that we don't skip some bootloader manipulation on classic18:12
jdstrandsergiusens: yeah, I was aware of that18:13
jdstrandwell, I remember that when looking at Touch18:13
blackout24pedronis, so the problem most likely is that there is no systemd-boot support?18:13
pedronisthere isn't indeed18:13
pedronisjust grub/uboot18:13
pedronisanyway those bootloader manip on classic18:14
blackout24I will see if I can work on that.18:14
pedronisshoudl go away18:14
pedronisin the next weeks18:14
sergiusensjdstrand oh shucks, I was wondering if that would lax the security requirements for it a bit :-)18:14
jdstrandsergiusens: well, it isn't so much about well-behaved code like chromium, it is about ill-behaved code that could take advantage of the shared access18:15
qengho"well behaved"18:16
jdstrandheh18:16
jdstrandwell-intentioned?18:16
qengho+118:16
sergiusensjdstrand so I know where to patch chromium; the problem is having it make its way to all the forks18:17
jdstrandright, I undertand the problem18:18
jdstrandunderstand18:18
jdstrandsergiusens: but that path does not fit with snaps-- it assumes a differently designed system18:19
example6Greetings everyone. I'm having trouble with my web server snap starting. When it starts it checks if a specified port is already in-use, and if it is, it quits and tries again. Currently I am able to run it perfectly fine on its own, but when run as a snappy service, it keeps failing, no matter what the port is.18:19
jdstrandsergiusens: I'm not saying we won't get something working for this case, just that it isn't obvious18:19
sergiusensjdstrand yeah, I understand the issue being on both sides18:20
example6I suspect this could be due to systemd trying it again immediately but I could be wrong18:20
example6It could also be some strange apparmor permission thing preventing it from taking up a port18:20
example6I don't really know where to go from here, so any help would be greatly appreciated.18:20
jdstrandsergiusens: note that with the recent shm PR, you can create a file in /dev/shm rather than having to worry about a directory, etc18:20
sergiusensexample6 have you plugged network-bind?18:20
example6sergiusens, I haven't, I'll try that!18:21
jdstrandsergiusens: so the path is /dev/shm/snap.$SNAP_NAME.whatever_you_want18:21
sergiusensjdstrand yup saw the PR18:21
jdstrandthat shoudl at least make the patch simpler18:21
qenghoexample6: And "dmesg" might be helpful next time.18:21
jdstrandbut, still working through it. maybe we'll introduce another interface, not sure. I'm actually tasked with something else atm and will be circling back to these things, perhaps late next week18:22
example6qengho, I did check dmesg but didn't see anything related18:22
plarselopio: ok, that test that hits a kernel bug for me, but seems to work for you - I can make it work, but only if I run it by hand from *outside* the snap. When I try to run it from within the snap, I hit the problem. Maybe there's some permission/isolation issue here? (I did install with --devmode)18:23
example6Is there any way to plug network-bind from package.yaml inside the actual snap? I haven't been able to get snapcraft.yaml to properly initialize the snap as a service18:25
example6So i've just been using snappy build .18:26
zygaexample6: package.yaml?18:26
zygaexample6: are you using 16.04 or 15.04?18:26
example615.0418:26
zygaexample6: there are no interfaces in 15.0418:26
kyrofaexample6, you should be able to make this work from Snapcraft. Can you pastebin the YAML you're trying to use?18:27
zygakyrofa: ^^ 15.0418:27
kyrofazyga, yeah I know. Should still be able to get a service running in 15.04 :)18:27
zygayep though not with plugs and slots :)18:28
kyrofaRight18:28
zygablackout24: I think that what you are doing is extremely cool and useful!18:30
example6I'd prefer not to have to udpate ubuntu-core at this point since some other things are depending on this format but from what it sounds like I might not have a choice...18:30
zygacome to the dark side, we have cookies and plugs and interfaces18:30
kyrofaexample6, you don't need to. We're happy to help you with 15.04 stuff, assuming what you're trying to do is possible of course18:31
kyrofaexample6, did you refer to examples when building your snapcraft.yaml? Maybe this one: https://github.com/ubuntu-core/snapcraft/blob/1.x/examples/shout/snapcraft.yaml ?18:31
blackout24zyga, thanks. It's also seems like a good way to sharpen my Go skills. I like Go very much.18:32
example6Yes I did, but I need this to run as a service, and daemon: service wasn't having it start at all18:33
kyrofaexample6, can you pastebin your YAML? Happy to help18:33
example6Sure, one sec18:33
kyrofaexample6, you're probably suffering from the fact that most of our public-facing documentation is on Snappy 16, not 15.0418:34
kyrofaexample6, so you need to make sure you're referring to examples compatible with 15.0418:34
example6The snapcraft.yaml is _very_ simple, I'm just using the Makefile to copy some scripts and premade executables into place and then a wrapper to start them: http://pastebin.com/ppgSnSSz18:36
example6But this was pulled from 16.04 documentation I think, and I didn't find anything about using snapcraft that would work with our system18:36
kyrofaexample6, indeed, that's a Snapcraft 2.x-compatible YAML18:37
kyrofaexample6, try this:18:37
example6I see now that the example you linked is different18:38
kyrofaexample6, http://pastebin.ubuntu.com/16244497/18:38
=== josepht` is now known as josepht
kyrofaexample6, indeed, notice that they're examples from Snapcraft 1.x rather than master18:39
example6kyrofa: so that did indeed properly start it as a service. However, it's still failing to bind to any specific port18:53
example6I did add plugs: [network, network-bind] to the service18:54
example6But since it's 15.04 it doesn't support plugs apparently18:54
kyrofaRight, in 15.04 they're caps18:55
kyrofaexample6, so try caps: [network-service]18:55
kyrofaexample6, another example (with caps): https://github.com/ubuntu-core/snapcraft/blob/1.x/examples/tomcat-maven-webapp/snapcraft.yaml18:57
example6kyrofa, even with the caps it doesn't want to bind to 808019:06
kyrofaexample6, what is the error? Care to pastebin your syslog?19:06
example6Could this have any relation to my wrapper script copying the executables to /var/lib/apps/.... on the first run?19:07
example6Sure19:07
example6http://pastebin.com/XL7J02E519:08
kyrofaexample6, huh. Have you verified that the specific port ISN'T in use?19:10
example6Well, I've changed the port to any number of other arbitrary values19:11
example6It just fails with the same message for the different port19:12
sergiusenszyga you should check for NULL as well https://github.com/zyga/snappy-runtime-helper/blob/master/snappy.c#L2719:17
kyrofaexample6, yeah I don't see any snappy-related issues there...19:18
kyrofaThose messages are coming from the service itself19:19
kyrofaAnd I don't see any denials or anything19:19
sergiusensdholbach https://github.com/seehuhn/moon-buggy/pull/2 or use my branch for better moon-buggy satisfaction :-019:20
dholbachvery nice! :)19:21
example6Hmm, okay. Thank you for all the help kyrofa.19:22
sergiusensdholbach 92kb and saves scores :-)19:22
sergiusensworks in cleanbuild too ;-)19:23
dholbachnice19:23
dholbachvery nice! :-)19:23
example6Is it possible to add a service start/stop delay in snapcraft.yaml or should I just put a sleep in my wrappers?19:38
example6In 15.04 to be exact19:38
example6I'm having a problem now that my application is looking for a .hidden type folder in /root/ (*since it seems to be run by root) but AppArmor is denying this operation. Is there any cap I can reference to allow this?19:43
=== chihchun is now known as chihchun_afk
zygasergiusens: thanks! good point19:53
=== chihchun_afk is now known as chihchun
jdstranddavidcalle: hey, I'm looking at https://developer.ubuntu.com/en/snappy/guides/ and the links under 'Snappy Internals' are all 404s20:09
example6Hmm. well I solved the permission problem but it still doesn't want to bind to port 8080.20:14
example6If my script is running from /var/lib/apps, does it get denied network access?20:14
example6it doesn't say so in syslog20:15
scherreyDoes snappy use systemd?20:33
oparozscherrey, yes21:22

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!