/srv/irclogs.ubuntu.com/2015/05/29/#snappy.txt

=== c74d is now known as Guest62930
rsalvetisergiusens: what is the current process to release a new webdm version?02:09
=== c74d3 is now known as c74d
rsalvetibeuno: is the store fully back already?02:11
pittiogra_: to avoid confusion, are you looking into fixing mountall to create a symlink instead of writing mtab?04:59
=== c74d3 is now known as c74d
mvolool: re serial port support for grub - could we simply enable this why default? or is there a (security) risk here?06:02
mvopitti: one issue I noticed while writing upgrade/failover tests is that systemd will drop me into a emergency shell sometimes. I would prefer it to log and reboot, can I simply provide my own "emergency.service" unit that will override the default one (sorry if thats a silly question)?06:11
tbrmvo: what would make serial different from a screen and keyboard in terms of security? If you have physical access to a system, security is toast.06:47
* tbr was unhappy that he had to screw around with grub configs and uefi to get snappy working on real embedded intel hardware06:47
mvotbr: I agreee but wanted to double check if there is something I might have missed06:48
mvoif there is no risk I'm much in favor of just enalbing it by default06:48
pittimvo: yes, that should work fine; i. e. adding an /etc/systemd/system/emergency.service -> /lib/systemd/system/systemd-reboot.service ought to work06:49
mvopitti: sweet, thanks06:50
pittimvo: (warning, haven't tested -- but I see no reason why it shouldn't work)06:50
mvothats fine, I will test, just wanted to double check if its a valid assumption or not06:50
pittimvo: oh, for testing you probably want to put it into /run/, not /etc ?06:50
pittimvo: or is that something which should be done in snappy in general, not just for testing?06:51
mvopitti: in general06:51
pittimvo: if so, it shoudl be done differently to avoid /etc/06:51
pittimvo: ah ok, then I misunderstood you06:51
mvopitti: the idea is that it should auto-reboot if its in "try" mode at least so that it can fallback to the "good" partition06:51
pittimvo: so then snappy.deb could ship a /lib/systemd/system/emergency.service.d/snappy.conf with something like06:52
pitti[Service]06:52
mvopitti: aha, nice06:52
pittiExecStartPre=06:52
pittiExecStart=06:52
pittiExecStart=/bin/systemctl --force reboot06:52
pittiType=oneshot06:52
pittimvo: i. e. rip out the parts from emergency.service which you don't want (reset the ExecStart* commands), and then call what you do want (from systemd-reboot.service)06:53
pittimvo: that can be shipped in a deb, statically, without having to touch /etc/06:53
mvopitti: cool06:54
mvopitti: I will do that then06:54
pittimvo: foo.service.d/something.conf is like upstart's *.override files06:54
mvo(add it to the relevant bugreport for now and later to it to be precise :)06:54
pittimvo: see man systemd.unit, grep for foo.service.d/06:54
mvothanks06:54
=== erkules_ is now known as erkules
dholbachgood morning07:23
loolmvo: so I suspect the serial port name might differ (e.g. ttyS0 and ttyS1) and that people might want to disable that if they actually need the serial port for something else07:43
loolmvo: it kind of feel like a deployment option to me: headless servers where you want to use an existing serial port, but some platforms wont have it; perhaps there's a smart way to detect it though, like "press space now to enable serial console" during grub startup?07:44
beowulfmorning08:01
Chipacamo'in08:04
davidcalledholbach, morning, just a heads up that the doc diff I was hoping for in my script is not possible, django cms is doing way too many annoying things when publishing. Well, it's possible of course, but at this point, that would just be a waste of time :)08:26
dholbachok... let's have a chat in a bit :)08:29
JamesTaitGood morning all; happy Friday, and happy Learn About Composting Day! 😃08:40
Chipacamvo: you around?08:54
mvoChipaca: yes08:56
mvoChipaca: working on a fix for -lp1449032-08:56
mvoChipaca: what can I do for you?08:56
Chipacamvo: silly question: any reason why we're using “setActive/unsetActive” instead of “activate”/“deactivate” ?08:57
mvoChipaca: none really, go for the new name08:57
Chipacak08:57
Chipacaregen is basically unsetactive/setactive, hence why i'm in that code08:58
Chipacait's painfully obvious i haven't looked into this bit of code before :)08:58
mvoheh :) is it that simple? thats very cool08:58
mvoChipaca: meh, I hope its not too terrible :/08:59
Chipacathat thing about us not parsing yaml twice? all lies as soon as we look at these08:59
Chipacawhat's mroe08:59
Chipacawe parse the yaml inside (un)setActive08:59
Chipacaand then parse the click manifest08:59
Chipacato get the package type08:59
Chipacawhich is in the yaml08:59
mvoohh08:59
mvouff08:59
Chipacawe win some kind of award for that08:59
Chipacanot sure it's a good award :)08:59
Chipacabut at least we're consistent :)08:59
* mvo hands Chipaca a broom stick and a janitor award09:00
mvoChipaca: lol@consistent09:00
mvoChipaca: well, time to kill that click compat stuff entirely, oh well09:00
mvoChipaca: thanks a lot for going into these stables of augean09:00
Chipacaheh. 's not that bad :)09:01
beowulfshould i label "webdm front end stuff" as webdm or webdm client?09:25
* beowulf thinks 'webdm'09:26
=== fgimenez_ is now known as fgimenez
Chipacaaugh! bad branch09:48
* Chipaca aborts it09:48
Chipacamvo: Alas! Needs fixing. Inline.10:03
zygahi, I'm following https://developer.ubuntu.com/en/snappy/tutorials/build-snaps/, I installed the hello-world snap but when I execute it I get:10:06
zyga(BeagleBoneBlack)ubuntu@localhost:~$ hello-world.echo10:06
zygamkdir: cannot create directory ‘/tmp/snaps/hello-world.sideload’: Permission denied10:06
zygaany ideas?10:06
Chipacazyga: yes10:06
Chipacazyga: there's a bug :)10:06
Chipacazyga: or :-/ depending on your lookout10:07
Chipacazyga: easy to workaround10:07
zygaChipaca: thanks, what should I do?10:07
Chipacazyga: sudo chmod 01777 /tmp/snaps10:07
zygathanks10:07
zygaChipaca: any chance for the update to the core snap?10:07
Chipacazyga: and, if you want, edit snappyd in /apps/webdm/current/snappyd and add -m01777 to the mkdir10:08
zygaChipaca: oh, I removed webdm10:08
Chipacazyga: 15.04.1 is in progress10:08
Chipacazyga: ah, ok :)10:08
* zyga just rebooted10:08
zygalet's see how that works10:08
Chipacazyga: then the error should go away on its own in a bit10:08
Chipacaheh, ok10:09
Chipacazyga: let me know how it goes10:09
Chipacazyga: there might be other bits still making that directory with the wrong permissions10:09
Chipacazyga: in rolling the whole thing is avoided because you have private tmps10:09
zygathanks10:09
Chipacazyga: but that's still WIP a bit10:09
zygawhile we're talking, how reliable is deb2snap in practice? I read the code so I kind of know how it works, I want to try taking a big/complex set of debian packages and making them available in a snap10:10
Chipacazyga: thank you! and if anything seems wrong or inconvenient please do let us know10:10
zygaChipaca: (works after reboot, so that's good)10:10
Chipacazyga: I have not looked at at deb2snap, tbh10:10
zygaChipaca: thanks, I'll let you know after I try :)10:10
Chipacazyga: mterry is your guy for that, but he's not around right now10:11
Chipacazyga: or vanvugt10:11
Chipacazyga: (look at "top contributors" on https://launchpad.net/deb2snap )10:12
zygayep, I'll stay in touch10:12
beunorsalveti, downloads yes, uploads are working but I need to check if they are autonatically scanned10:39
=== Guest53 is now known as clurrrr
=== leandrosansilva_ is now known as leandrosansilva2
sergiusensbeowulf: around?12:11
sergiusensbeowulf: what am I to expect from https://code.launchpad.net/~stephen-stewart/webdm/repent-harlequin-said-the-ticktockman/+merge/260120 ?12:12
beowulfsergiusens: magic12:12
sergiusensbeowulf: because I don't see the description, download_size or installed_size anywhere12:13
ogra_sergiusens, isnt that clear from the url ?12:13
ogra_s/url/branch name/12:13
sergiusensogra_: yeah, but it doesn't do that ;-)12:13
beowulfsergiusens: one sec, context switch12:13
sergiusensbeowulf: ok12:14
* sergiusens notices that at least a second has already pass12:14
Chipacaasac: ogra_: the problem is that services don't have something mkdir'ing /tmp/snaps for them, and so some of them do it themselves, and they don't all set the right permissions to then allow other apps to create subdirs of /tmp/snaps12:14
beowulfsergiusens: so you are the ticktockman!12:14
Chipacaasac: ogra_: for webdm, it's fixed on trunk i think, but not released yet12:15
Chipacaasac: ogra_: snappy itself fixes it in a better way, again on trunk12:15
ogra_Chipaca, yeah12:15
sergiusensChipaca: was going to release yesterday, but hell came12:15
sergiusensreleasing today would hide the issue for people using webdm at least12:15
Chipacasergiusens: we call him "beuno" when he's in the room12:15
* beuno lols but opts-in Chipaca into "experimental" features12:16
* Chipaca hugs beuno 12:16
beowulfsergiusens: updated the mp, it gives snap icons a label if they aren't 'app' types and adds the download size to the descriptions12:19
beowulfsergiusens: the next branch allows you to then sort by download size12:19
sergiusensbeowulf: problem is, I don't see a description or any other text12:21
beowulfsergiusens: do you mean on lp, or in webdm?12:21
sergiusensbeowulf: there, browser was caching the css it seems12:22
beowulfsergiusens: yeah, i will add some cache busting tokens to the js and css urls12:23
sergiusensbeowulf: the ubuntu-core installed size is whack, maybe it should be hidden?12:23
sergiusensbeowulf: for now at least12:23
beowulfsergiusens: yeah, i can hide it or make it "n/a" or something (which i'd prefer to do for symmetry)12:23
beowulfsergiusens: but i wanted you to see and fix it :)12:24
sergiusensbeowulf: n/a is fine12:24
beowulfsergiusens: i think if we're showing ubuntu-core as an installed snap it should have the same info (and it would be useful to see that, imo)12:24
sergiusensbeowulf: I already said that I agreed! :-)12:27
beowulffix it fix it fix it12:28
sergiusensbeowulf: also, in the column view I see the installed sizes but not the download_size, but what irks me is the column alignment or lack of ;-)12:29
beowulfsergiusens: i think i fix that in the next branch12:30
sergiusensbeowulf: ah, k12:30
beowulfsergiusens: fwiw, i'm not using download size at all until i get some time to think a bit more about how the store should look and work12:32
kyrofaHey sergiusens, what is your websocket vision for webdm?12:33
rsalvetimorning12:33
sergiusenskyrofa: that is a broad question!12:34
sergiusenskyrofa: not sure if I want to do something restful over a websocket or use it as a complimentary data channel for the http/rest stuff12:35
dholbachjdstrand, davidcalle just made lp:~ubuntudeveloperportal-editors/+junk/snappy-docs available which should help us keep the site up to date12:35
sergiusenskyrofa: I need to discuss with beowulf as well12:35
Chipacamvo: more bad news :(12:35
dholbachjdstrand, I'm looking at meta.md right now - it's where you said yesterday:12:35
dholbach<jdstrand> for example: 'security-template' should be a subpoint of 'caps'12:35
jdstranddholbach: yeah, that was the one to forget :)12:36
dholbachok12:36
jdstrandI was being silling on security-template and caps12:36
sergiusensbeowulf: it is in Details though12:36
jdstranddholbach: but notice that services doesn't have subpoints12:36
beowulfsergiusens: ah12:36
sergiusensbeowulf: can I add one more critique, can the snappy package type be left aligned?12:36
dholbachjdstrand, ok cool - looking12:37
kyrofasergiusens, Haha, I can be less broad! We have a specific use-case I wanted to discuss12:37
jdstranddholbach: same with binaries12:37
davidcallejdstrand, and binaries as well12:37
beowulfsergiusens: in grid style?12:37
jdstranddholbach: I haven't reviewed all of it, but those two for sure12:37
sergiusenskyrofa: want to set something up for later today?12:37
sergiusensbeowulf: in row style12:37
kyrofaSure! What time works best?12:38
sergiusenskyrofa: 1:30 PM ART?12:38
beowulfsergiusens: yes, the row isn't in good shape and i want to tidy it up, these mps are mostly about grid style though12:38
davidcallejdstrand, dholbach, I'm trying to figure out why12:38
zygaogra_: nice12:38
kyrofasergiusens, sounds great! I'll make an invite12:39
jdstranddavidcalle: I thought I saw some django things mentioned in lp:snappy for the docs. does snappy/15.04 need similar changes?12:39
beowulfkyrofa: sergiusens: webdm client would probably benefit more from server sent events that websockets12:39
jdstrandsomething about spacing the indents right12:39
kyrofabeowulf... how do you do that without something like websockets?12:40
davidcallejdstrand, hmm...12:40
* davidcalle is afk for a moment, brb12:40
jdstrandif that is needed, then I imagine everything in docs/* should be looked at in both snappy and snappy/15.0412:40
kyrofabeowulf, do you maintain the web interface then?12:40
beowulfjdstrand: that might have been me? django vrs githubmarkdown flavours?12:41
mvoChipaca: heh, thanks! looks like its not my day today12:41
beowulfkyrofa: i do yes, with sergiusens and others here12:41
kyrofabeowulf, want to be included in our HO?12:42
sergiusenskyrofa: yeah, add him if the time works12:42
Chipacamvo: it isn't often i suggest more tests in an MP. I feel dirty.12:42
jdstrandbeowulf: maybe? this is developer.ubuntu.com/snappy vs docs/*12:42
beowulfjdstrand: yeah, i tried to fix some issues with list indentation which i think were caused by people using github markdown, whereas developer.u.c uses django which uses a different flavour12:43
jdstranddavidcalle: also another data point-- the services/binaries thing in meta.md on the website is the same sort of issue that security.md on the website had: subpoints weren't being indented correctly. you fixed the latter on your end iirc12:44
jdstrandah12:44
sergiusensChipaca: pretty please https://code.launchpad.net/~sergiusens/webdm/metaupdate/+merge/26057912:44
jdstranddavidcalle: see what beowulf said ^12:44
jdstrandwe should probably document that and have a linter for docs/*12:44
Chipacasergiusens: s/Ubuntu Core Snappy/Snappy Ubuntu Core/ I guess?12:45
* sergiusens wants to kill readme.md and add a description entry in package.yaml12:45
Chipacaalso, an end to the name/title/description nonsense12:45
sergiusensChipaca: hmm, I think not, I conciously wrote it like that Ubuntu Core uses Snappy and this allow device management12:45
Chipacasergiusens: +1'ed, then12:46
sergiusensChipaca: thanks12:46
beowulfkyrofa: not sure what your HO is about, but sure, why not :)12:46
Chipacasergiusens: ma che grazie, go do some reviews yourself now :)12:47
sergiusensbeowulf: websockets and the rest of the snappy vision12:47
* sergiusens tries to find inspiration and write something up before then12:47
kyrofabeowulf, might be at the tail end of your day, so no pressure.12:48
kyrofabeowulf, I'm writing the Unity8 scope for installing/uninstalling/launching snaps12:48
kyrofabeowulf, like... the local version of the webdm web interface12:48
dholbachdavidcalle, looks like it works with the markdown command12:49
beowulfkyrofa: have you looked at sse's?12:49
dholbachdavidcalle, at least for the type: app / oem / framework case12:50
kyrofabeowulf, no I didn't know someone else was working on this12:50
beowulfkyrofa: i looked briefly a while back, websockets might be a bit overkill and are reportedly a pain to work with12:51
kyrofabeowulf, oh haha-- I thought you were saying someone named sse was making a unity8 scope, but you're talking about server-sent events... sorry12:53
beowulffor webdm, it's mostly responding to events, what it sends to the server is occasional and regular xhr is fine for that12:53
D_Centhi, i've built a snappy ubuntu image for the raspberry pi 2 with the image by lool and for some reason, it only shows 128 MB RAM available although there should be 1 GB - how can i adjust that?12:53
kyrofabeowulf, still early in the morning for me :P12:53
beowulfkyrofa: haha12:53
ogra_D_Cent, that seems to be an issue with the bootloader files used on that image ...12:53
kyrofabeowulf, I've not actually looked into SSEs. Let me read a little12:54
beowulfkyrofa: so for install, you're mainly listening for progress or success events, but you only send one 'install' event12:54
kyrofabeowulf, see, this is good! You and I need to talk more often12:54
beowulfkyrofa: try this too http://chimera.labs.oreilly.com/books/1230000000545/ch16.html#EVENTSOURCE_API12:54
beowulfkyrofa: downside (for me, not you, i think) is sse's are not available on IE12:55
D_Centogra_: is there a quick way to fix it myself?12:55
* beowulf breaks for lunch12:55
kyrofabeowulf, not to mention I'm interacting with the API from Go. DOM manipulation may not help us there12:55
ogra_D_Cent, not that i know of ... there were suspicions that it works if you replace start.elf with one from an official RPi2 image12:56
ogra_D_Cent, i'm tasked to look into that but wont manage to do so before monday i fear12:56
kyrofasergiusens, I sent the invite-- did I get the time right?12:57
D_Centogra_: okay thank you :) then i'll check back on monday12:57
sergiusenskyrofa: yes, it could be 1h earlier if it help beowulf13:00
kyrofabeowulf, ah, but behind the scenes it just keeps the SSEs just keep the TCP socket open, huh? I can probably work with that13:01
kyrofasergiusens, alright, I'll wait to hear what beowulf thinks after his lunch and modify if necessary13:01
loolD_Cent: that's a known bug; ogra is looking into it; Paolo's image doesn't have this issue; we'll soon have this fixed13:11
ogra_yeah, i'll merge paolos stuff in13:12
davidcallejdstrand, beowulf, django isn't involved in the current issue, the cms only takes html and docs are converted locally before uploading13:22
Chipacamvo: sergiusens: when regenerating systemd and binary wrappers and such, i should only look at frameworks and apps, not other types of packages, yes?13:27
sergiusensChipaca: seems correct13:27
ogra_do we have other types ?13:28
ogra_(yet)13:28
sergiusensogra_: gadget, os and kernel13:28
sergiusensogra_: as part of yet, we have oem13:28
ogra_ah, i thought they dont exist yet13:28
ogra_ah, right13:28
davidcallejdstrand, you were right, snappy trunk is fine, snappy 15.04 is not (https://bazaar.launchpad.net/~snappy-dev/snappy/snappy/view/head:/docs/meta.md VS http://bazaar.launchpad.net/~snappy-dev/snappy/15.04/view/head:/docs/meta.md)13:31
davidcalleIndentation issue in 15.04 markdown13:32
jdstrandinteresting13:32
jdstrandI just use the 'markdown' command to see if there are errors. clearly it is not enough13:32
jdstrandor at least in the way that I invoke it13:33
* jdstrand notes he did not write meta.md, but imagines others are doing something similar)13:33
beowulfdavidcalle: i made those changes, fwiw13:33
davidcallejdstrand, for the moment, are you aware of any changes between trunk and 15.04 for this file?13:33
davidcallebeowulf, the bad ones or good ones ? ;)13:34
beowulfdavidcalle: https://bazaar.launchpad.net/~snappy-dev/snappy/snappy/view/head:/docs/meta.md is me13:34
jdstranddavidcalle: when I merged my 1 char MP yesterday, there was a conflict13:34
davidcallebeowulf, ok, thanks to you we have found the issue then13:35
jdstrandI can't comment on the rest of the doc (I don't really modify too often)13:35
beowulfdavidcalle: without the correct indentation the list wasn't appearing in the guides, which made it hard to understand13:35
davidcallebeowulf, indeed13:36
beowulfdavidcalle: i thought it was because the markdown in django needs 4 spaces not 213:36
jdstrandbeowulf: is there a tool you use to make sure it will display well in django?13:36
beowulfjdstrand: i don't know of one13:36
* davidcalle replaces current guide with one from trunk, text is identical13:37
beowulfkyrofa: sergiusens: if you could move the ho an hour forward I would be grateful :)13:38
kyrofabeowulf, done!13:39
kyrofabeowulf, by the way, looks like libs exist to polyfill SSEs into IE. I'm sure you're aware?13:39
beowulfkyrofa: yeah, my first thought was if we had everything working in webdm with hr polling, we'd add sse support as a conditional13:40
beowulfs/hr/xhr13:40
beowulfdon't want to poll hr13:40
kyrofabeowulf, hr may not give you what you're looking for13:41
beowulfkyrofa: true13:41
D_Centlool: thank you for letting me know!13:45
beowulfkyrofa: have you seen the latest webdm, it has install/uninstall progress (more correctly, it's download progress in the install phase)13:46
kyrofaI think so, via polling yes?13:46
beowulfkyrofa: yes13:46
beowulfkyrofa: is polling not a option for a scope, or not a good option?13:47
kyrofabeowulf, sort of. It's a bit of a long-winded discussion, perhaps best saved for the HO :)13:49
beowulfkyrofa: np13:49
kyrofabeowulf, thanks for coming, it'll be a good conversation! I'm looking forward to hearing another "client"s view13:51
beowulfsergiusens: hey, i created a snap with no icon, sideloaded it, and the packages api has a value for the icon attribute (name + sideloaded + version)14:09
beowulfsergiusens: this means that the browser shows a broken image, rather than, if it were empty, a default image14:09
Chipacapitti: you around perchance?14:10
beowulfsergiusens: i can look for a file extension in the client, but maybe this is something to fix in the api results?14:10
pittihello Chipaca14:10
Chipacapitti: hello hello! i've got systemd questions, i think14:10
sergiusensbeowulf: I'll fix that, care to log a bug or task?14:11
beowulfsergiusens: happy to, any preference?14:11
sergiusensbeowulf: non at all14:11
Chipacapitti: I'm wanting to have a thing (unit?) that runs on boot that regenerates the service unit files (for frameworks and apps)14:11
beowulfsergiusens: bug it is14:12
Chipacapitti: the code i have, with no extra work, will try to start the unit after creating the unit file14:12
Chipacapitti: so I'm thinking that maybe there's a way to tell systemd not to try to start things itself, given i'll be doing so manually14:12
beowulfsergiusens: https://bugs.launchpad.net/webdm/+bug/146008514:13
ubottuUbuntu bug 1460085 in webdm "snaps with no icon should not have a value for the icon attribute in the api" [Undecided,New]14:13
pittiChipaca: "things" that synthesize unit files during boot from configuration are called "generators"14:13
Chipacapitti: ok :)14:13
Chipacapitti: i have generators! woo14:13
* Chipaca feels all sophisticated now14:13
pittiChipaca: see http://www.freedesktop.org/wiki/Software/systemd/Generators/ ; we have a few, look at some shell ones how they work: /lib/systemd/system-generators/openvpn-generator14:13
pittiChipaca: or the one from postgresql-common14:13
* Chipaca reads systemd.generator14:14
pittiChipaca: essentially, they create units in /run/systemd/generator.. somewhere, which systemd will then pick up14:14
pittiChipaca: they go well together with template units (but they don't necessarily have to use them)14:14
Chipacahmmm14:14
Chipacamaking snappy use these will take more work14:15
pittiChipaca: yes, whether or not, or when/how to start units is entirely up to you14:15
pittiChipaca: by default, a unit never gets started -- you have to make it a requires/wants of another unit; that's part of what the generator has to do14:15
Chipacapitti: will systemd then keep it running if i manually start it?14:16
pittiChipaca: sure14:16
Chipacathat is:14:16
elopioping fgimenez: I've been playing with rewriting the tests in go, like http://paste.ubuntu.com/11433366/14:16
elopionow I'm not sure if we should rewrite all of them, or leave them alone and work in tests with a controlled and deterministic environment.14:16
elopiolike: instead of matching edge|stable, run the tests once for edge and once for stable.14:16
pittiChipaca: it's nothing too magic -- it's just an unit which is in /run (thus doesn't survive a reboot), which happesn to be generated by a program called early at boot14:16
elopiowhat do you think?14:16
Chipacapitti: ok14:17
Chipacapitti: but i should leave the requires bits in place so if a user manually restarts a framework, apps will restart appropriately14:17
pittiChipaca: ^ I don't understand what that has to do with generators?14:18
Chipacapitti: I think I *don't* want generators14:19
Chipacapitti: because if I use generators, unless i'm misunderstanding14:19
pittiChipaca: restarting dependencies when you restart a unit is done with PartOf=14:19
jdstrandbeuno: interesting: https://public.apps.ubuntu.com/download/com.ubuntu.snappy/docker/com.ubuntu.snappy.docker_1.5.0.002_all.snap - I thought all the old snaps were removed?14:19
Chipacapitti: a daemon-reload regenerates them14:19
pittiChipaca: correct14:19
Chipacapitti: which would cause snappy to restart everything14:19
jdstrandbeuno: https://public.apps.ubuntu.com/download/com.ubuntu.snappy/go-example-webserver/com.ubuntu.snappy.go-example-webserver_1.0.4_multi.snap too14:19
pittiChipaca: err, no, why?14:19
Chipacaand then systemd will try to start them, and snappy will have started them14:20
Chipacaand everything will get in a fight14:20
pittiChipaca: is snappy inotifying /run/systemd/generators/ or something such and restart stuff on file changes?14:20
Chipacapitti: so, as I said perhaps too succinctly, i'd have to do more work to do this with generators14:20
beunojdstrand, not removed, but filtered out because they don't have a release. I can remove them if needed14:20
pitti(that would be crazy -- don't do that!)14:20
Chipacapitti: no! no, it's that14:20
Chipacapitti: the generation of the unit files14:21
Chipacapitti: is done by snappy14:21
Chipacapitti: and the easy way to do them14:21
Chipacapitti: is to just deactivate and then reactivate the snap14:21
pittiChipaca: a generator should *never ever* start stuff by its own -- perhaps that's the confusion?14:21
Chipacapitti: and that causes the services to be (re)started14:21
Chipacapitti: i get that14:21
jdstrandbeuno: I see. I don't think they have to be removed on my account (I am just fetching everything and can fix the script here), but it feels a little odd that they are in there14:21
jdstrandbeuno: so, up to you :)14:22
Chipacapitti: that's why i say, if i wanted to use generators i'd have to do more work14:22
pittiChipaca: hm, the only "generated" unit files that I saw were in /etc/, i. e. the units which get build as a "transformation" of the yaml14:22
fgimenezelopio, i'd prefer to run the tests for each environment, with the state as controlled as possible and with concrete regex's14:22
pittiChipaca: I still think we misunderstand each other in a major way14:22
Chipacapitti: perhaps :)14:22
Chipacapitti: let me start from the top14:22
pittiChipaca: daemon-reload will not restart units14:22
pittigenerators don't stop/start units14:22
Chipacapitti: wait14:23
Chipacapitti: let me start over14:23
pittiack14:23
Chipacapitti: snappy has this idea of "activating" and "deactivating" snaps14:23
Chipacapitti: when it activates a snap, it creates a bunch of files, including the unit files14:23
Chipacapitti: and then the services are started14:23
Chipacapitti: this is done as part of an install, for example14:24
pittiack; but that happens in /etc/systemd, right?14:24
Chipacapitti: the old version is deactivated, the new version is activated14:24
Chipacapitti: correct14:24
Chipacapitti: that is as things are right now, and it works just fine14:24
Chipacapitti: now14:24
elopiofgimenez: so, I propose to write one simple test that installs a package and confirms it works. 04_test_install_hello sounds like a good candidate for a controlled environment.14:24
elopiomaybe we can have two versions, one that installs it from a snap we keep in our branch, and one that installs it from the store.14:24
Chipacapitti: we're wanting to regenerate those unit files on boot (or on os update, which is essentially the same thing)14:24
pittiChipaca: oh, that'd be a rather major difference design-wise14:25
Chipacapitti: the *easiest* way to do that, is to grab a list of all "active" snaps14:25
Chipacapitti: deactivate them14:25
Chipacapitti: and then reactivate them14:25
pittiChipaca: (I mentioned the possibility of building them at boot time in Austin, using a generator and /run -- that would avoid having to write into /etc/ entirely)14:25
Chipacaevereything would get generated, services started, all fine14:25
pittiChipaca: but ok, let's follow along with the /etc/ approach for now14:25
pittiChipaca: ok, understood14:26
fgimenezelopio, sounds great, the one that installs the local version could run in ci too, should we check for internet access at the first stages?14:27
Chipacapitti: so, to make this work, i *think* all i've got to do is remove the bits that makes systemd start the services automatically14:27
beowulfogra_: hi, i'm trying to debug a nodejs snap, where does log output go?14:28
Chipacapitti: is that right?14:28
ogra_beowulf, nowhere by default ... you can hack the start script and put some env var in place14:28
* ogra_ checks the var name14:28
pittiChipaca: i. e. the "systemctl start" after you install a snap, generate the unit? :-)14:28
pittiChipaca: sure; you can rewrite units in /etc/ all the time, that won't affect running ones14:28
elopiofgimenez: not sure how to handle that. For the experiments we did with the click store, we passed an environment variable, like: CLICK_STORE_URL=fake14:29
elopioit defaulted to being not set, which would use the real store.14:29
Chipacapitti: no, i mean the requires or whatever it was in the unit files that causes them to be started on boot14:29
pittiChipaca: if you want to do this rewriting at runtime14:29
Chipacapitti: (because snappy would be starting them as part of the 'activate' dance)14:29
elopiofgimenez: maybe we can make it smarter. It will default to fake if there is no internet connection. But we should still be able to specify if we want to run the tests with or without the real store.14:29
Chipacapitti: what does "at runtime" mean?14:29
Chipacapitti: just to be clear :)14:30
pittiChipaca: right; as I said, unit changes will only become active at boot in general; you can "force" the stopping/starting of new/old units with "systemd default", but that's a rare (and not widely known) operation14:30
pittiChipaca: well, not at early boot time or image build time; i. e. "while the system is running"14:30
Chipacapitti: not early boot; this would be a snappy command run from an ad-hoc systemd .. unit? target?, once "everything else" is up (ie, i want it to run more or less where ubuntu-snappy.frameworks-pre.target is today)14:31
ogra_beowulf, i think it is just DEBUG=* ... or alternatively call node with the --debug option ... then logging should go to syslog14:31
elopiofgimenez: actually, we can start even more simple. We need a test to check that a snap can be installed from the .snap file. Lets write that, package it, put it to run on CI. And then we figure out how to solve the one from the store.14:32
pittiChipaca: terminology: everything is a "unit", a target (or a service) is a particular type of unit14:32
pittiChipaca: right14:32
Chipacapitti: services stick around, targets come and go?14:32
pittiChipaca: so if I got your question right: systemd by itself will not stop/start stuff automatically when you change unit files on disk; you have to manually do that14:32
beowulfogra_: thanks, will try14:32
Chipacapitti: but nothing breaks if i create unit files from a unit file14:33
ogra_backjlack, ah, found it ... NODE_DEBUG=*14:33
pittiChipaca: no; services start processes, targets are a kind of "meta-service" to provide synchronization points for services or group related services; but a target doesn't start processes by itself14:33
ogra_http://www.juliengilli.com/2013/05/26/Using-Node.js-NODE_DEBUG-for-fun-and-profit/14:33
elopiofgimenez: do you know about debian packaging for go?14:33
pittiChipaca: in sysvinit terms: service == init.d script, target == runlevel14:33
fgimenezelopio, ok14:33
Chipacapitti: gotcha14:33
pittiChipaca: right; dynamically createing unit files from an unit file is unusual and brittle, but as long as you only expect them to become active at the next boot, it's all fine14:34
pittiChipaca: brittle in the sense of "it might not do what you think it does"14:34
Chipacai'll need to test it then :)14:35
fgimenezelopio, not used it before, i've seen that dh-golang manages it14:35
Chipacapitti: the proper way in any case seems to be with generators14:35
Chipacapitti: i'll try to move things around first, and then look at generators14:35
Chipacaotherwise it'll be two big changes in a single branch :)14:35
pittiChipaca: right, don't mingle them14:36
elopiofgimenez: yes, seems simple. But I'm missing some details, like how to overwrite the build so the tests binary gets generated too.14:36
elopiowe need to add go test -c somewhere in the rules.14:36
pittiChipaca: from a behavioural POV at runtime systemd-generator units in /run and snappy-written units in /etc are pretty much identical14:36
pittiChipaca: /etc is harder to upgrade, as you have to deal with possibly admin-modified files; i. e. whenever you change the YAML → unit translation, you have a lot of work14:37
jdstrandbeuno: weird, check this out: http://paste.ubuntu.com/11433759/14:37
pittiChipaca: units in /run are nicer in the sense that you don't have to worry about upgrade issues, they are rebuilt at every boot and you don't need to have anything in /etc/14:38
jdstrandbeuno: the 'name' in the json is com.ubuntu.developer.zacharyigielman.piano, but the constructed download is com.ubuntu.developer.zacharyigielman.piano.upiano_2.0_all.click14:38
pittiChipaca: but of course generators need to run at boot, and thus they slow down boot (if you do trivial operations it doesn't matter, but if you have to do expensive stuff it might)14:38
jdstrandbeuno: (ie, 'upiano' is in the filename but not in the json)14:38
pittiChipaca: i. e. what snappy does now to build an /etc/systemd/foo.service is by and large a generator and coudl also run at boot to output to /etc/14:39
fgimenezelopio, yes, probably override_dh_auto_build will do14:39
jdstrandbeuno: this is the only one I've seen like this14:39
pittiChipaca: so it's a "boot speed" vs. "upgrade maintenance" tradeoff, not more, not less14:39
beunojdstrand, interesting. nessita ^^^14:39
Chipacapitti: this work is exactly to regenerate unit files because we're changing them on upgrade14:39
pittiChipaca: stopping/starting etc. is exactly theh same14:39
Chipacapitti: so yeah, /run would be a better match14:39
jdstrandbeuno: should I be pestering nessita with all this stuff? (I feel like I am being a bother)14:39
beunojdstrand, you are not being a bother!14:39
jdstrandI don't want to bother nessita either though...14:40
jdstrandhehe14:40
ogra_jdstrand, you are, but we pay you for that :P14:40
jdstrandhaha14:40
beunojdstrand, she's an expert botheree14:40
jdstrandogra_: nice one :)14:40
ogra_:)14:40
beunojdstrand, file names don't mean anything to the system14:42
beunoso we might have played  fast and loose during a data migration14:42
nessitareading backlog14:43
jdstrandbeuno: yeah, it isn't a huge deal-- it is just the one. I do a cheap check in this store-fetch script to see if it is on disk and that one kept getting downloaded over and over again14:43
jdstrandjust the one so far14:44
beowulfogra_: just checking, i meant where would console.log stuff go; is it not logged in snappy without NODE_DEBUG?14:44
ogra_node doesnt actually write anything to stdout by default14:45
nessitabeuno, jdstrand we have 3 or 4 apps in sca that have an badly formatted package name, I reported these a while ago in the onlineservices list14:45
ogra_so yeah, prefix your node call in your service start script with the var and you get its output in syslog14:45
nessitabeuno, this is ont of them, the developer will not be able to upload a new version for the same package, he needs to upload a new package with a name without a dot in it14:46
ogra_or if you manually run it (which you shouldnt, since the environment will differ) prefix your command line with it14:46
beowulfogra_: but console.log is process.stdout.write, maybe i misunderstand14:47
beowulfogra_: yeah, i couldn't run it manually without setting env vars14:47
nessitabeuno, in summary somehow we allowed (no longer allowed) the upload of a package with a dot in the short name, which breaks all assumptions about the dot being namespace-short name splitter14:48
beowulffwiw, it's confusing to get a perl error :)14:48
beowulfheartwarming, but confusing14:48
jdstrandbeuno, nessita: fyi, I am not at all blocked. adjust the script: WARNING:store-fetch:Skipping 'com.ubuntu.developer.zacharyigielman.piano.upiano_2.0_all.click' (already present (v2))14:49
jdstrandadjusted*14:49
jdstrandso I have a very cheap check and a less cheap check for existence14:50
zygaI have a conceptual snappy question, can I write (where I mean can I it means "should I, from snappy POV") a snap that gives you a test/benchmark tool and then another snap that knows how to use the first one _iff_ it is present?15:19
zygaor should that other snap be a framework that knows how to run tests?15:20
zygaand each test can still be a snap15:20
zygaor should I build a very fat snap that has everything I can think of15:20
zygaand about sandboxing15:20
asaczyga: snaps can talk to each other through REST right now15:21
zygado I understand right that sandboxing is applied by ubuntu-core-launcher?15:21
asacbut maybe just bundle everything together15:21
asacyes thats the launcher that puts the processes in the right realm15:21
zygaasac: can snaps see each other as installed in the FS?15:21
asacof compsec/cgroup/apparmor15:21
ogra_yeah, i would just ship everything in one snap15:21
asaczyga: i think they cannot right now...15:21
asacbut try :)15:21
zygayeah, I'm about to15:21
zygatrying to wrap my head around this15:22
zygaI want to take three example tests (something for storage, stomething for network, something for cpu)15:22
zygaand bundle them with plainbox in a snap to run15:22
asacright. if those are plugins to y our benchmark tool just bundle them all in one15:22
zygaplainbox is mostly easy (apart from some .so files I currently bundle that I need to get from the archive)15:22
asactry deb2snap i would say if its from the archive15:23
zygabut all the tests are defined as thin wrappers (just metadata needed to run it) and a reference to a 3rd party tool which is typically just shipped straight from debian15:23
ogra_you wont see much of the system though ...15:23
zygayeah, I already use it15:23
ogra_in your snap env15:23
zygaogra_: can I get a shell somehow with all the constraints applied (for learning?)15:23
asaczyga: so hello-world.env is a script15:24
zygaasac: I played with that15:24
asacyou could make a hello-world.bash maybe15:24
zygaasac: ah :D15:24
zygagood idea15:24
zygathanks15:24
asacmaybe could work15:24
asacguess a script that just starts bash or busybox-sh15:24
asacmight be interesting to put in hello-world in general15:24
ogra_that wont realyl ive you the info how it looks *inside* the snap i guess15:24
zygaasac: is python defined to be a part of the os snap for 15.04?15:24
asacogra_: it should15:24
ogra_sadly15:24
zygaogra_: why not? should it not limit everything?15:24
zygaogra_: for that process15:24
asaczyga: yes python is on the image15:24
asacit should work zyga ... give it a try15:25
zygaasac: +1 thanks for that! (we bundle python for .click but this saves a lot of effort)15:25
zygayep, will do15:25
ogra_asac, well, it will give you env output ... but if you try to read /proc/cpuinfo from commandline, will it actually block ?15:25
ogra_(which it should if run as a service)15:25
asacyeah it will behave like it will behave for a normal snap app15:25
asacnot sure if its block15:25
ogra_ah, cool15:25
asacor just no permission15:25
ogra_right, you cant read most of 7proc15:26
ogra_*/proc15:26
asacbinaries should see the world like 99.99% same as a service15:26
zygaogra_: is version important for local dev (do I need to increment it) or can I just keep changing and reinstalling without any changes to metadata15:26
ogra_version is important fgor regenerating apparmor profiles15:26
ogra_if your apparmor setup never changes you dont need to bump the version15:27
zygaok, thanks15:27
ogra_(i personally usually edit my snaps in /apps/<snap name>/current ... )15:27
ogra_way faster turnaround time than re-packing all the time ;)15:27
zygaogra_: so just hack on the device?15:28
ogra_thats what i do15:28
zygayeah, works for non-compiled code, good point15:28
asacjdstrand: [ 2678.082648] audit: type=1326 audit(1432913282.515:15): auid=1000 uid=1000 gid=1000 ses=7 pid=1197 comm="sh" exe="/bin/dash" sig=31 arch=c000003e syscall=109 compat=0 ip=0x7fbc7b91bd47 code=0x015:28
asaci cannot run sh15:28
ogra_once i'm done, i tar up the whole dir and dump it back into my snap dir on the PC15:28
zygaogra_: do you have something for cross compilation?15:28
ogra_(there are hidden subdirs you should remove before snapping it up then)15:28
ogra_zyga, nope, not yet15:29
ogra_i only did nodejs, shell and perl on snappy yet15:29
zygaogra_: I love pex and it works great but one thing it does do is that it builds everything locally15:29
zygaogra_: and that means .so files inside15:29
ogra_yeah15:29
zygaogra_: I'll focus on python and whatever-tests-need15:29
ogra_you could look at node-snapper ...15:30
zygayeah, I got bad-system-call15:30
* zyga needs to read a bit about the security stuff15:30
ogra_it rolls a chroot, installs nodejs and then compiles the npm modules ...15:30
asacjdstrand: i cannot run busybox sh either15:30
zygaogra_: oh, cute15:30
ogra_zyga, on what host system ?15:30
asacjdstrand: also 10615:30
asacoh its different :(15:30
ogra_i see bad-system-call on utopic ... but not on trusty15:31
asac109 and 10615:31
zygaogra_: I installed it to my snappy beagle15:31
asacnot sure what the diff iss15:31
zygaogra_: I did the /bin/bash snap15:31
* asac tries to remember how to locally hack it to see what problems come next15:31
ogra_ah15:31
asachmm how to find which syscall it is?15:31
asactyhicks: what is 106 and 109?15:31
jdstrandasac: what is the output of 'sudo sc-logresolve /var/log/syslog'15:31
asacahhh15:32
asacMay 29 15:28:02 localhost kernel: [ 2678.082648] audit: type=1326 audit(1432913282.515:15): auid=1000 uid=1000 gid=1000 ses=7 pid=1197 comm="sh" exe="/bin/dash" sig=31 arch=c000003e syscall=109(setpgid) compat=0 ip=0x7fbc7b91bd47 code=0x015:32
asacMay 29 15:30:25 localhost kernel: [ 2820.891522] audit: type=1326 audit(1432913425.322:16): auid=1000 uid=1000 gid=1000 ses=7 pid=1237 comm="busybox" exe="/apps/hello-world.sideload/1.0.16/bin/busybox" sig=31 arch=c000003e syscall=106(setgid) compat=0 ip=0x7f974f849c03 code=0x015:32
jdstrandscmp_sys_resolver 106 would also do it15:32
asacso setgid and setpgid15:32
asacis that not good?15:32
zygaogra_: snapy could use a generic environment variable to detect snapy stuff is in effect, I love SNAP_xxx but something like XDG_$appropriate=snappy would be useful for libraries15:32
asacnow setuid15:32
jdstrandwe aren't allowing them because there is nothing for them to setgid to that we can control15:32
asacand now it works :)15:32
asac(amd64)ubuntu@localhost:~$ hello-world.shell15:33
asacBusyBox v1.22.1 (Ubuntu 1:1.22.0-9ubuntu1) built-in shell (ash)15:33
asacEnter 'help' for a list of built-in commands.15:33
asac$15:33
zygaasac: how do you tweak policy ?15:33
zygaasac: I don't have experience with that15:33
asaczyga: soi just did it the hardway:15:33
asacsudo vi /var/lib/snappy/seccomp/profiles/hello-world.sideload_shell_1.0.16~15:33
asacand then i added those names at the end15:33
asace.g. setgid15:33
asacsetpgid15:33
asacetc.15:33
asacuntil it worked15:33
asacbut thats just for quick hacking15:33
zygaahh15:33
zygabut that's generated, right?15:34
asacfor each binary/service there should be such profile file15:34
asacyeah gets generated on install/update15:34
asacfrom templates etc.15:34
jdstrandzyga: you likely want to look at https://developer.ubuntu.com/en/snappy/guides/security-policy/15:34
ogra_this is why you need to bump the version if somethin there changed15:34
zygajdstrand: I already have that open, I need to read/understand it15:35
zygaI know how seccomp works15:35
jdstrandogra_: you don't need to do that for seccomp changes15:35
zygabut I'm green on apparmor15:35
ogra_jdstrand, no, for apparmor15:35
jdstrandwhat are we talking aboug, seccomp or apparmor?15:35
ogra_both ?15:35
zygayeah, effective, I think15:35
asacfor busybox sh15:36
asacit was just seccomp15:36
jdstrandzyga: that guide also links to https://wiki.ubuntu.com/SecurityTeam/Specifications/SnappyConfinement if you want to go deep15:36
asaczyga: to answer your question:15:37
asac$ ls /apps15:37
asacls: can't open '/apps': Permission denied15:37
asac:P15:37
asaci love the hello-world shell15:37
ogra_yeah15:37
zygaasac: thanks15:37
asacjdstrand: you say you dont like thhe idea to have setuid etc. in seccomp profile?15:37
jdstrandasac: so, regarding setuid and friends15:37
asacshouldn a process be able to setuid itself?15:38
ogra_setuid has friends ?15:38
asaclike start as root, daemonize15:38
jdstrandasac: what is it setuiding to?15:38
asacchange to unpriviliged user?15:38
jdstranddaemonize to what?15:38
jdstrandright15:38
jdstrandso, 'yes'15:38
zygajdstrand: so (haven't read anything yet) in one sentence, how does apparmor interact with seccomp? can it grant extra rights? (eg allow via seccomp but filter in apparmor?)15:38
asacjdstrand: http://paste.ubuntu.com/11434660/15:38
asacjdstrand: i dont know what busybox sh does15:38
jdstrandbut snappy doesn't create a user for the app to drop to15:38
asacseems something similar like bash does on start :)15:38
mvojdstrand: can you help me debugging a apparmor issue? I have the following in dmesg http://paste.ubuntu.com/11434557/ for the ubuntu-core-launcher. but the /etc/apparmor.d/usr.bin.ubuntu-core-launcher has http://paste.ubuntu.com/11434609/ which should be ok, no? apparmor_parse -d -r /etc/apparmor.d/usr.bin..ubuntu-core-launcher also tells me its loaded15:38
asacjdstrand: try it ... let me give you the .snap15:39
zygamvo: o/15:39
jdstrandjeez too many parallel conversations15:39
mvohey zyga15:39
jdstrandwhy am I so popular in this instant :)15:39
asacjdstrand: http://people.canonical.com/~asac/tmp/hello-world_1.0.16_all.snap15:39
jdstrandok, one thing at a time15:39
asacjdstrand: it has a hello-world.shell15:39
asacthat calls bash15:40
jdstrandasac: right, I get that15:40
asacor rather dash15:40
asacjdstrand: i dont know how to find out ... strace on my desktop maybe?15:40
jdstrandso the problem is that dash is setuid to something, but we don't know what. we could allow setuid in general but we didn't yet because apps don't know what to setuid to as it is15:41
jdstrandeg15:41
jdstrandapache on Ubuntu drops to www-data15:41
asacjdstrand: so seems dash only does setpgid15:41
jdstrandif apache were packaged as a snap, we would want to create a user for apache15:41
asacbusybox also setuid15:41
asacjdstrand: setpgid(0, 25652)15:41
jdstrandthat's fine. let me get to those in a moment15:41
asacgetpgrp()                               = 2564715:42
jdstrandI'm trying to describe the situation15:42
asachttp://paste.ubuntu.com/11434743/15:42
jdstrandthere is a trello card for creating users15:42
jdstrandand there is a trello card to add seccomp arg filtering15:42
jdstrandin this manner, snappy would create the user and the generate policy that allows setuid/etc only to that user15:43
zygaasac: how can I follow high-level snappy developmet plans (like that thing with creating users for snappy packages)15:43
jdstrandbut, since we don't have the user and the seccomp arg filtering and apps don't have a way to know what to go to, we disallow setuid and friends for now15:43
jdstrandok, that is the situation15:43
jdstrandasac: what group is 25652?15:44
asacjdstrand: so busybox sh runus setgid and setuid to my user15:44
asacso just resets to my user15:44
asacnot sure why15:44
asacsetgid(1000)                            = 015:44
asacsetuid(1000)                            = 015:44
asacthats me15:44
jdstrandright15:44
jdstrandthat is odd15:44
asaclet me look at the dash one15:44
jdstrandor maybe it isn't-- I don't know historically why an app would do that15:45
jdstrandsarnold, tyhicks: can you comment on the conversation from the last minute or two?15:45
asacjdstrand: the group it sets (25652) isnt one that i have15:45
asacin /etc/gropup etc.15:46
asacjust something random it seems15:46
jdstrandright15:46
asacsetpgid15:46
asacwhats that?15:46
tyhicksjdstrand: the 25652 that is passed to setpgid() is not a group id - it is a pid15:46
jdstrandsetpgid is for the process group15:46
jdstrandright15:46
asacoh15:46
jdstrandtyhicks: I'm thinking we are going to need to allow those since there is no way to arg filter it15:47
asacso then i dont know what setpgid does15:47
asacseems to take two pids as input15:47
jdstrandtyhicks: unless it is unsafe and the app needs to simply not do it (or we allow them to make an exception)15:47
asacmaybe setpgid is safe?15:48
asaclet me see if dash works with just that one15:48
jdstrandthat is what we are thinking about15:48
asacyeah seems to be enough15:48
asacfor dash15:48
asacbusybox seems to do fun stuff15:48
asaci prefer busybox, but dash is fine to start i guess :P15:48
asaci dont see why setgid and setuid would be safe either though15:49
jdstrandtyhicks: I'm thinking setpgid and setpgrp we might allow15:49
asacthink its standard unix practices to use those to drop privileges, no?15:49
* zyga loves old system calls, with lots of magic values and special cases 15:49
jdstrandtyhicks: if they are safe15:49
tyhicksjdstrand: I'm thinking about those two atm15:49
tyhicksasac: regarding setuid/setgid, there is no defined user and/or group to drop privileges to15:51
jdstrandwhen the trello cards are implemented, we can do it. however, I don't think that will fix busybox15:52
tyhicksasac: we need to provide guidance to snappy developers about what users/groups they can use when they need to drop privileges15:52
jdstrandbecause busybox is changing to the current user (ie, 1000) and that won't be what is added to the policy15:52
tyhicksjdstrand: agreed15:52
jdstrandtyhicks: so, they could drop to something that already exists, like 'daemon' today15:53
jdstrandtyhicks: but that makes me uneasy15:53
jdstrandtyhicks: for the same reasons as the nobody user-- it doesn't actually mean 'totaly unprivileged'15:54
jdstrandalso, if everyone drops to the same user, then the isolation isn't as great15:54
tyhicksthat's my biggest issue with it15:54
jdstrandalthough, we have no DAC isolation now with root15:54
jdstrandso maybe it is a stepping stone15:55
asacjdstrand: so if i run the shell as root maybe it works?15:55
asachmm. guess not15:55
=== om26er is now known as om26er|dinner
asacso i am sure it setuid to something tht exists15:55
asacisnt a snappy root process allowed to just go to any uid?15:56
asacwhy wouldnt it?15:56
tyhicksjdstrand: should the launcher define env variables for the uid and gid that the process is allowed to drop to?15:56
jdstrandie, today we create snappy-unprivileged uid/gid, then add seccomp arg filtering then we say you can change to 'snappy-unprivileged' or in the future the uid/gid we create for you15:56
jdstrandtyhicks: probably15:56
tyhicksby creating env variables, we can change those later on without the app caring15:56
jdstrandthe uid/priv dropping/seccomp arg filtering needs to be prioritized and specced out15:56
tyhicksand we can also dynamically generate the appropriate seccomp filter from the launcher15:57
jdstrandasac: a snappy root process is not currently allowed to go to any uid, because we disallow setuid :)15:57
asaci know, but cant see why we would get so much into the way of standard unix procedure... like apache surely wants to do that etc.15:58
jdstrandasac: once snappy devs define how this is supposed to work, we can let apps do stuff in a controlled manner15:58
asacthrough setuid syscall?15:58
jdstrandasac: we don't want to be in the way of unix procedure, we want to allow this15:58
jdstrandit just isn't implemented yet15:58
asachmmmmmmm15:59
* Chipaca going AFK for a few hours. Let's call this EOW \o/15:59
jdstrandyes, through setuid syscall15:59
asacah ok15:59
jdstrandthere are trello cards for it15:59
asaci wouldnt like to see another function etc.15:59
asacwe should just hook into the real thing and do the right thing15:59
asacok call now15:59
jdstrandthe thing is, today, apache isn't going to work right because there is no postinstall that creates the user it expects15:59
asacyes we need to spec out how to do per-app-users16:00
jdstrand(though, with apache we happen to have www-data predefined in /etc/passwd and /etc/group, but that is beside the point)16:00
asacyeah thats awful and we shouldnt rest because of that16:00
jdstrandno16:00
jdstrandasac: this sounds like something for our architect group to discuss and bring on board. I think it would be them, mvo, me and tyhicks at a minimum16:01
jdstrandfor getting the design going16:01
jdstrandbut maybe they are busy now16:02
asacsounds like something that fits into the developer experience epic16:03
fgimenezelopio, will you begin with the 04_test_install_hello changes?16:03
zygaasac: could I join some calls (just as an observer to track snappy development direction better?)16:03
jdstrandso the problem and need are all understood (hence trello), it is just the experience and implementation are not specced out16:03
jdstrandasac: oh, but there is a mechanism for allowing extra syscalls via 'security-override'16:04
elopiofgimenez: yes, I'm on that. I'll send you an email when I EOD with what I could finish.16:04
fgimenezelopio, ok thx16:05
jdstrandthat said, we might just allow setpgid and setpgrp16:05
jdstrandtyhicks: let's not forget that ^16:05
mvofgimenez, elopio: do you already have a board or anything where you capture ideas? I would like to put "ensure services keep runing after a upgrade" on it :) (i.e. extend the current upgrade test to check that a intalled webserver is still listening)16:06
tyhicksjdstrand: apps could attempt to do devious things with setpgid()/setpgrp(), such as placing themselves in a process group of a different app16:06
mvojdstrand: did you see my apparmor question from earlier? not rushing you, I noticed that you are busy, just wanted to ask if I should re-post the pastebins :)16:06
jdstrandmvo: oh sorry, I did, then was trying to deal with one conversation at a time16:06
mvojdstrand: yeah, totaly fine, just ping me when you have a moment :)16:07
tyhicksjdstrand: that could result in some unexpected behavior such as waitpid(0, ...) returning when unexecpted processes exit16:07
fgimenezmvo, not yet afaik, it would be nice :)16:08
tyhicksjdstrand: that might be solveable by having the launcher call setsid(2) before exec'ing a snap executable but I'd have to look into it more (would be best if someone that works on init systems told us what we need to do)16:09
jdstrandmvo: the rules are ok. are you sure they are in effect?16:09
jdstrandmvo: ie, did you run 'sudo apparmor_parser -r /etc/apparmor.d/usr.bin.ubuntu-core-launcher' ?16:10
jdstrandtyhicks: the init systems question kinda went by me-- perhaps ask slangasek?16:11
mvojdstrand: I did, is there some sort of caching or anything? I can run apparmor_parser -r -d for you to double check16:12
jdstrandmvo: there is caching, but -r will ignore it16:12
jdstrandmvo: also, '-d' I don't think actually loads it into the kernel16:13
mvojdstrand: http://paste.ubuntu.com/11435160 is the debug output from the loading16:13
mvojdstrand: oh, hold on a sec, let me re-run without -d then16:14
mvojdstrand: woah, see, I knew why I needed to talk to you, thanks!16:14
jdstrandah, good!16:14
jdstrandI had to look at the man page for -d and saw it didn't load16:15
mvojdstrand: how does the caching work? i.e. does it compare files? I have a image here from rick that seems to be broken16:15
jdstrandmvo: the launcher is a system profile, so its cache file is in /etc/apparmor.d/cache16:15
mvojdstrand: i.e. the apparmor.d/usr.bin.ubuntu-core-launcher looks correct but when I ran it it seems to apply a older config ? I will debug further now that I know about -d16:16
mvojdstrand: great, thanks a bunch. is there a way to "disassemble" the cache? as a way to compare that with the real file?16:16
jdstrandif you look at rick's image, do stat /etc/apparmor.d/cache/usr.bin.ubuntu-core-launcher /etc/apparmor.d/usr.bin.ubuntu-core-launcher16:16
jdstrandmvo: I don't think so, but will refer you to jjohansen here16:17
mvojdstrand: thanks, thats very helpful, I dig deeper16:17
jdstrandmvo: so things to keep in mind: if the cache is older than the profile (mtime), then the apparmor boot script will regenerate the cache16:19
jdstrandmvo: apparmor_parser -r does not consult the cache. you can use apparmor_parser -r -B /etc/apparmor.d/cache/usr.bin.ubuntu-core-launcher to load the cache16:20
mvojdstrand: thanks again16:22
jdstrandjjohansen: actually, does apparmor_parser -r /path/to/profile consult the cache? the man page suggests it but I never thought it did16:22
jdstrandmvo: so, you can use apparmor_parser -r -B /etc/apparmor.d/cache/usr.bin.ubuntu-core-launcher for sure to load the cache, and apparmor_parser -r --skip-cache /etc/apparmor.d/usr.bin.ubuntu-core-launcher to not load from cache for sure16:23
mvojdstrand: its the cache16:24
mvojdstrand: --skip-cache makes it work, -r alone is not enough16:24
jdstrandmvo: also something to keep in mind, system image generation tries to precompile the cache so it doesn'16:24
jdstrandt have to be done on first boot16:24
mvojdstrand: let me try again from a freshly booted rick image just to be sure I'm not running into side-effects16:24
jdstrandat least on touch. I imagine we are doing the same on snappy (rsalveti could possibly confirm)16:24
jdstrandmvo: if the cache file on the disk is newer than the profile but still has the old profile rules, then suggests something is wrong in the image generation process16:25
mvojdstrand: yes, that or something with the upgrade and the timestamps during the upgrade16:26
jdstrandyes16:26
mvojdstrand: yep, fresh boot (qemu with --snapshot) pastebinit fails, apparmor_parser --skip-cache -r makes it work. I file a bug. thanks again for your help16:29
jdstrandmvo: ok, 'cool'16:30
jdstrandmvo: note this from touch: http://paste.ubuntu.com/11435517/16:31
mvojdstrand: heh :)16:31
jdstrandmvo: just for context on the types of things to be thinking about with timestamps and the cache16:31
jdstrandobviously, the launcher isn't a click16:31
jdstrandand the directories are different16:31
jdstrandbut timestamps are pretty darn critical when dealing with cache files16:32
mvojdstrand: oh absolutely16:33
jdstrandtyhicks: so, I'm conflicted on the setpgid/setpgrp. on the one hand, I totally hear what you're saying. on the other hand, it seems like something pretty common: http://paste.ubuntu.com/11435621/16:38
jdstrandtyhicks: I'm leaning toward allowing it and then we file a bug to make it safer16:39
jdstrandtyhicks: I'm not sure how we can make it safer... there are LSM hooks for task_setpgid. but clearly, seccomp won't be enough16:40
mvojjohansen: if you could give me a hint if its possible to get information out of a cache apparmor profile, that would be great! I suspect we have a bug in snappy (upgrade or image creation) when they get out of sync but to gather more data about the problem I need to figure out more about the content of the cached one16:42
jdstrandmvo: that is where you need jjohansen16:42
mvoyeah :)16:45
mvorickspencer3: here is your bug https://bugs.launchpad.net/snappy/+bug/1460152 - I was wrong about the permissions, I was looking at the wrong place, its really a issue with upgrade or image generation and that results in a stale apparmor cache :/16:46
ubottuUbuntu bug 1460152 in Snappy "(sometimes?) becomes confused about apparmor rules for ubuntu-core-launcher" [Undecided,New]16:46
tyhicksjdstrand: they're probably harmless to allow16:48
=== om26er|dinner is now known as om26er
jdstrandtyhicks: ok, then I'll allow them. if you feel more should be done with mediation, let's open a feature bug and add to backlog16:48
jdstrandtyhicks: sound ok?16:49
tyhicksjdstrand: ok - i'll think about if there's anything possible to do16:52
jdstrandgreat, thanks16:52
jdstrandI guess I should say 'great'16:53
jdstrandasac: ok, uploaded ubuntu-core-security to wily for setpgid/setpgrp, so it should hit rolling/edge later today. 15.04 will get this as part of the SRU17:02
asacjdstrand: ok, when will that hit?17:02
asacthe SRU? any news on the updated image schedule from rsalveti ?17:03
jdstrandasac: not beyond what was discussed on wed. this is on the non-critical part currently17:03
jdstrandie, the stable promotion won't block on this being missing (currently, we can change that)17:04
zygajdstrand: how does ubuntu snappy core sru work?17:06
jdstrandzyga: the same as the normal SRU process will get the updates into edge. then there is a manual process currently being defined by the snappy core team (ie, rsalveti) for promotion from edge -> beta -> alpha -> stable17:08
jdstrandzyga: you might read this for background: https://developer.ubuntu.com/en/snappy/guides/channels/17:08
jdstrandoh, I forgot 'rc' in my little ascii flow17:09
* rsalveti reads backlog17:28
zygajdstrand: thanks, I ask because currently the cert team is involved in the sru process for normal ubuntu17:29
zygajdstrand: and we're not (at least not yet) doing that for snappy17:29
jdstrandzyga: ah, you might also be interested in this bit I am working on for the security team: https://wiki.ubuntu.com/SecurityTeam/PublicationNotes#system-image_updates_.28DRAFT.2917:32
sarnoldjdstrand: I think you got your answer, but we definitely need to allow setpgid, setpgrp, setsid, if we want shell job control to work17:32
jdstrandsarnold: ack. we already allowed setsid and the other two I just fixed17:33
jdstrandsarnold: thanks! :)17:33
sarnoldjdstrand: woot :)17:33
=== davmor2 is now known as davmor2_hols
rsalvetimvo: jdstrand: apparmor cache is actually done as part of livecd-rootfs17:44
rsalvetinot in system-image, so let me check if we're actually running a similar script in there17:45
rsalvetiI remember we had super weird issues on touch when the rules were bind-mounted from the device tarball17:46
rsalvetias that wasn't causing the cache to be regenerated (even when the timestamp was correct)17:47
rsalvetiwhich is why we now have a package in the archive with the device rules17:47
rsalvetijdstrand: mvo: how we're pre-compiling the cache on touch http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk/view/head:/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot17:52
ogra_rsalveti, mvo, oh, i meant to ask about this, a big chunk of the hook scripts in the livecd-rootfs tree in core are not executable ...17:53
* ogra_ was wondering if that is on purpose to not have them run17:54
rsalvetiogra_: remember we also have our own version in our ppa17:54
rsalvetihttps://launchpad.net/~snappy-dev/+archive/ubuntu/image17:54
ogra_of livecd-rootfs ?17:54
rsalvetiyeah17:55
ogra_how does that work ?17:55
rsalvetithis ppa gets used when building the image17:55
ogra_the buildd doesnt know the PPA when it install that package17:55
ogra_*installs17:55
ogra_only later once it created the build chroot ... or did that change17:55
rsalvetiasac: jdstrand: right, can you let me know about the bug number for it once you start the SRU process?17:56
rsalvetiasac: jdstrand: my goal is to have our first stable update during next week17:56
ogra_also that feels pretty wrong ... we already have our own hooks dir, why do we need anything else forked from the main livecd-rootfs17:56
rsalveticreated a short meeting on monday to make sure we're not missing anything17:56
rsalvetiogra_: mvo should know more17:57
ogra_k17:57
rsalvetione reason could be because of the freeze17:57
ogra_ah ... didnt think of that17:57
mvorsalveti: hm, indeed aparmor.d/cache is a rw mount, I wonder why we have that, I assumed it would all be done on image generation time17:58
sergiusensogra_: because of system-image (we didn't package fork in time)17:58
mvoogra_: this sounds like a accident, are they really not run?17:59
rsalvetimvo: right, on touch we create it as part of the image, then we copy it over at a rw path and bind-mount during boot time17:59
ogra_mvo, i'm not sure, they all have a hashbang though17:59
rsalvetiwe don't yet support pre-cached content during updates17:59
mvook17:59
ogra_i dont think they are piped into some shell call in live-build, but i might be wrong17:59
rsalvetilog should tell18:00
rsalvetibuild log18:00
rsalvetiguess only if printing stuff though18:00
ogra_yeah, most dont print anythin18:00
ogra_g18:01
mvoI can reproduce the  tempdir issue via stable->edge 15.04 update :/18:02
ogra_damn18:03
asacnice18:04
asacmvo: well done18:04
asacits one of those things that is dangerous i tell you18:04
rsalvetiyeah18:05
rsalvetiif the right apparmor cache is not in place, we can make the device useless18:05
* asac super worried18:05
ogra_rsalveti, mvo all fine, seems they get executed even without executable bit set18:05
asacthat we dont have the upgrade under control fully18:05
* ogra_ sees + echo I: Remove unneeded files from /usr/share/doc 18:05
ogra_I: Remove unneeded files from /usr/share/doc18:05
ogra_which is non executable in the code18:06
elopiomvo: we are using your document of better tests in the etherpad.18:06
ogra_asac, we have a similar issue on the phone with /var/log ownership that nobody can explain18:08
ogra_(being flipped after some upgrades ... not reliably reproducable ... )18:08
rsalvetiat least mvo found a way to reproduce it18:08
rsalvetiit seems :-)18:08
ogra_i wonder if we face some core bug in system-image18:08
=== devil is now known as Guest16350
jdstrandrsalveti: I'm only putting this out there as an option that you are free to ignore-- there are only 3 system profiles on core. pregenerated them doesn't buy us much on first boot-- about 2.2 seconds on bbb18:12
jdstrandrsalveti: maybe on upgrade hook could simply rm -f /etc/apparmor.d/cache/*18:12
rsalvetiyeah, that sounds easy enough18:12
ogra_wont that result in long boots ?18:13
rsalvetijust the first boot after install/upgrade18:13
rsalvetibut as it's just 3 system profiles18:13
rsalvetinot tons of click packages18:13
ogra_ah, not apps ... k18:13
jdstrandogra_: 13:12 < jdstrand> rsalveti: I'm only putting this out there as an option that you are free to ignore-- there are only 3 system profiles on core. pregenerated them doesn't buy us much on first boot-- about 2.2 seconds on bbb18:13
jdstrandright18:13
rsalvetimvo: ^^18:13
ogra_2sec are bearable :)18:13
jdstrandand it is only on boot after upgrade18:14
ogra_yeah18:14
jdstrandthe first boot after upgrade18:14
jdstrandrsalveti: could the a/b partitioning be getting in the way?18:14
jdstrandrsalveti: ie, are the writable bind mounted areas a/b'd as well?18:14
rsalvetithat's an interesting question18:15
* ogra_ thought not 18:15
ogra_we only have one writable and a and b18:15
jdstrandrsalveti: eg, if a has old cache and old profile and we reboot into b with new profile, do we get a's old cache file?18:15
rsalvetiyeah, are we sharing the same writable path for the cache?18:15
rsalvetiif so, then, hmm18:15
jdstrandidk18:15
ogra_most likely18:15
rsalvetinot good18:16
ogra_since we only have one writable partition18:16
rsalvetiogra_: can you confirm?18:16
ogra_yeah, i think i can18:16
ogra_three partitions ... two readonly, one writable ...18:17
ogra_writable gets mounted in initrd by label, no matter what readonly part is active18:18
ogra_and /etc/apparmor.d/cache is in /etc/system-image/writable-paths18:19
ogra_i guess we would want an a/b scheme there18:20
ogra_in a subdir or some such18:20
ogra_or via a bind mount that hides the real path18:20
jdstrandok, so I'm much more convinced that for now, we rm -f /etc/apparmor.d/cache/*18:21
jdstrandcause the alternative would be too risky for sru18:21
jdstrandwe need to implement the alternative for touch anyway18:22
jdstrands/touch/personal/18:22
beowulfsergiusens: are you waiting for something from me wrt my 2 reviews? i suspect you are but i've forgotten18:22
ogra_jdstrand, +118:22
sergiusensbeowulf: I was debugging something, let me grab those MPs now18:22
beowulfsergiusens: sorry, there's no rush, just checking18:24
rsalvetiogra_: jdstrand: yeah, let's just do this18:24
rsalvetisharing same writable path can be indeed dangerous18:24
rsalvetiit's usually desirable18:24
rsalvetibut we need to be careful18:24
ogra_yep18:24
ogra_sounds like quite some research project to find out which other files are bound to the readonly version18:25
ogra_s/are/should be/18:26
rsalvetiyup, will create a task/story for that in our board, so we don't forget18:26
rsalvetiactually, will just add as part of the 15.04.1 one18:26
rsalvetisince if there are additional bugs, we need to fix for the next release18:27
jdstrandso, thinking about it-- a's cache timestamp should be older than b's profile in the normal case. but, if the cache somehow got invalidated/regenerated it is possible for it to be newer than what would be in 'b'18:27
rsalvetiwhat is the reference used by fixrtc?18:27
ogra_last mount time18:28
rsalvetiright, but which mount partition?18:28
ogra_you added another one with a recent patch18:28
ogra_oh, good question18:28
ogra_hmm18:29
ogra_root= or systempart= is what it accepts18:29
rsalvetiright18:29
=== Guest16350 is now known as devil_
ogra_so root in our case18:30
ogra_BOOT_IMAGE=/boot/vmlinuz-3.19.0-15-generic root=LABEL=system-a ro init=/lib/systemd/systemd console=tty1 console=ttyS0 panic=-118:30
ogra_that is what i see on my kvm image here18:30
rsalvetiso in theory it would still be correct18:31
ogra_ah, and you added "creation date" as fallback18:31
rsalvetiunless we have a fallback I guess18:31
ogra_in case it was never mounted18:31
rsalvetiright18:31
rsalvetifallback/rollback18:31
ogra_well18:31
rsalvetiso if you flash b, boot b, regenerate the cache, and then aborts, it will boot a again18:31
rsalvetibut the cache will be invalid18:31
rsalvetifrom the a perspective18:31
rsalvetior better, could be18:31
ogra_i was just thinking about the clock .... if you switch from a to b but b was never mounted you might go backwards in time18:32
rsalvetiso yeah, sharing rw for apparmor is a bad idea18:32
rsalvetiogra_: yup :-)18:32
ogra_(with fixrtc)18:32
ogra_oh18:32
ogra_but you mount b to flash it :)18:32
ogra_all fine then i guess18:32
rsalvetithat's the hope18:33
ogra_even under the clock thats set for a ... so they shouldnt diverge to much18:33
rsalvetiright18:33
jdstrandso, /var/cache/apparmor (the one for apps) is setup the same way18:36
rsalvetialright, updated the bug18:36
jdstrandbut, for now I think it will handle things ok18:37
jdstrandwell, let me think18:37
jdstrandactually, the mechanism it uses for deciding whether to regenerate the profiles is not taking a/b into account18:38
jdstrandthe mechanism it currently uses happens to really be poor and I wouldn't mind it being redone18:39
jdstrandbut I was going to replicate the mechanism for the seccomp policy regeneration work that I will be starting soon18:40
ogra_OOOH !18:41
* ogra_ just hit ctrl-r in webdm 18:41
ogra_shiny !18:41
rsalveti:-)18:41
rsalvetisergiusens just uploaded a new version it seems18:41
jdstrandalright, I'll think about it-- I may have questions/ask for help in designing the implementation18:41
rsalvetijdstrand: sounds good18:41
sergiusensrsalveti: ogra_ yes, but the core problem I mentioned isn't solved, but I could easily replicate with 0.6.118:42
* sergiusens needs to read the core launcher code18:42
rsalvetisergiusens: why not?18:42
sergiusensrsalveti: it's not a webdm afaik18:43
rsalvetioh, right, isn't this the apparmor issue we're just discussing?18:43
rsalvetihttps://bugs.launchpad.net/snappy/+bug/146015218:44
ubottuUbuntu bug 1460152 in Snappy 15.04 "(sometimes?) becomes confused about apparmor rules for ubuntu-core-launcher" [Undecided,New]18:44
* rsalveti still trying to understand the issues we currently have18:44
sergiusensrsalveti: I don't see denials; I think it's more of running in namespaces18:46
rsalvetihm, ok18:46
sergiusensrsalveti: I don't get any apparmor denials nor seccomp issues, but the runtime thinks it's on some soft float hw env18:47
sergiusensjdstrand: do you have a bbb, maybe it will pop up easy to you :-)18:47
rsalvetihm, weird18:47
ogra_snake !!18:47
rsalvetiis this only happening on bbb?18:48
ogra_(in the snap store)18:48
rsalvetihahaha18:48
mvosnake?woah!18:48
sergiusensrsalveti: well !amd6418:48
* mvo needsmorespaces18:48
ogra_heh18:48
jdstrandsergiusens: I just installed webdm on my bbb18:50
jdstrandI am rebooting it18:50
jdstrandgive me a second to figure out what channel I am on, etc18:50
sergiusensjdstrand: right, so my issue is, with the core launcher, webdm fails in weird ways, running from cli works just fine18:50
jdstrandubuntu-core/15.04/edge18:51
jdstrandr6018:51
jdstrandsergiusens: does that have what is needed to reproduce?18:51
sergiusensjdstrand: http://paste.ubuntu.com/11434444/ the last three lines is what I see with no denials whatsoever; just try and install a package18:52
sergiusensI also logged a but about the core launcher taking ver arg[0]18:52
ogra_uuuh18:52
jdstrandruntime: this CPU has no floating point hardware, so it cannot run18:53
jdstrandthis GOARM=6 binary. Recompile using GOARM=5.18:53
jdstrandwhat is that??18:53
sergiusensjdstrand: yeah, that only happens when running under the launcher18:53
sergiusensjdstrand: 6, 5 are armv[5,6,7]18:53
ogra_i guess it nneeds some info from /proc ?18:54
jdstrandis this armhf vs armel?18:54
sergiusensogra_: right, there are no denials that I see of that make this obvious18:54
jdstrandlet me look at the profile18:54
sergiusensjdstrand: https://code.google.com/p/go-wiki/wiki/GoArm18:55
mvook, I think the problem with the apparmor is understood now, I updated the description of the bugreport in https://bugs.launchpad.net/snappy/+bug/146015 - I wonder if apparmor_parser could simply set the mtime of the cached file to the mtime of the source that was used to generate the cache, that would make this kind of issue go away18:56
ubottuUbuntu bug 146015 in Moblin Kernel "NTFS module can't be inserted" [High,Won't fix]18:56
rsalvetimaybe GOARM=5 is the default?18:56
mvoeh https://bugs.launchpad.net/snappy/+bug/146015218:56
ubottuUbuntu bug 1460152 in Snappy 15.04 "(sometimes?) becomes confused about apparmor rules for ubuntu-core-launcher" [Undecided,New]18:56
jdstrandsergiusens: http://paste.ubuntu.com/11437590/18:57
sergiusensjdstrand: are you using u-d-f from beta?18:57
jdstrandsergiusens: I mintioned I am on ubuntu-core/15.04/edge r6018:58
jdstrandmentioned18:58
jdstrandI just ssh'd in then ran that command18:58
ogra_sergiusens, hmm, whats the reason we build with GOARM=6 instead of 7 ?18:59
sergiusensjdstrand: yeah, I need to know what u-d-f you used, I bet you have /oem/beagleblack.canonical instead of /oem/beagleblack18:59
sergiusensogra_: it's using 718:59
sergiusensogra_: the message is completely bogus18:59
jdstrandI have /oem/beagleblack.canonical18:59
ogra_it says 6 above18:59
ogra_ah18:59
jdstrandI don't know what udf I used-- I generated the image weeks ago19:00
rsalvetiogra_: I believe it's kind of what you said19:00
rsalvetiit needs to query the system for the right support19:00
ogra_yeah19:00
rsalvetiand that might be br0k3n19:00
ogra_i forgot where exactly that info lives19:00
rsalvetii think it's /proc/cpuinfo19:00
rsalvetiisn't i?19:00
ogra_something with /proc.../axfr19:00
rsalvetiright19:00
ogra_or some such19:00
ogra_it was some letter combo19:01
rsalvetimight be easy to just check go's code19:01
sergiusensjdstrand: so quick hack to get going-> mkdir bak; sudo mv /oem/beagleblack.canonical bak19:01
sergiusensjdstrand: and restart webdm; are you using a prerelease image by any chance?19:01
* ogra_ thought it would be easy by just using the right google search terms :P ... but i'm not lucky 19:01
jdstrandsergiusens: prerelease image-- what do you mean? I am on ubuntu-core/15.04/edge r60, just booted into it19:03
rsalveti206 else ifeq ($(DEB_HOST_ARCH), armhf)19:03
rsalveti207     GOARM := 619:03
rsalvetiwe're actually building with goarm 619:03
jdstrandsergiusens: moving to bak and doing 'sudo systemctl start webdm_snappyd_0.7.service', it started19:03
jdstrand$ ps auxww|grep webdm19:04
jdstrandroot       862  1.6  1.4 838992  7120 ?        Ssl  19:03   0:00 /apps/webdm/0.7/bin/arm-linux-gnueabihf/snappyd19:04
sergiusensjdstrand: great, there's a bad strain somewhere and I need to find it, you are the second person today that has a bad image19:04
jdstrandI can connect to port 420019:04
rsalvetiit checks via syscall it seems19:05
rsalvetiso it could be seccomp19:05
jdstrandsergiusens: I can say that even though I just rebooted, I am getting told I need to reboot again19:05
jdstrandrsalveti: what syscall?19:05
rsalvetihttp://paste.ubuntu.com/11437793/19:05
jdstrandalso, we would see a seccomp denial19:06
rsalvetihttp://paste.ubuntu.com/11437796/19:06
rsalvetithe code the checks for the right arm support19:06
sergiusensthere is no seccomp denial though19:07
sergiusensbut, it also only fails when running under it19:07
jdstrandseccomp only supports EABI iirc19:07
jdstrandsergiusens: it isn't failing here now19:07
sergiusensjdstrand: you can install from the ui with no failure?19:08
rsalveti// do an EABI syscall19:08
rsalvetiMOVW$20, R7 // sys_getpid19:08
rsalvetiyeah, that's the eabi syscall it does19:09
sergiusensrsalveti: right, we are using GOARM=7 fwiw19:09
jdstrandI think it is a nice touch that Chipaca's 8nzc1x4iim2xj1g2ul64 is at the top of the list19:09
rsalvetisergiusens: debian/rules is only exporting GOARM=619:09
sergiusensrsalveti: and it works without confinement applied19:09
sergiusensrsalveti: webdm is not a deb19:09
rsalvetiright, was checking for golang-go itself19:10
ogra_trapped :P19:10
rsalvetinot sure how that would be connected to that19:10
jdstrandsergiusens: no: http://paste.ubuntu.com/11437836/19:10
rsalvetiwhen building another project that uses go19:10
sergiusensjdstrand: yeah, same error...19:10
jdstrandI still have the old libseccomp2... 2.1.1-1ubuntu1~ppa119:11
sergiusensjdstrand: if you stop webdm and go to /apps/webdm/0.7 and run it manually it all works fine19:11
jdstrandsergiusens: what version of libseccomp2 do you have?19:11
sergiusenslibseccomp2:armhf19:11
sergiusenssame19:12
jdstrandwhy is this image telling me to reboot and not rebooting into the updated system?19:12
sergiusensjdstrand: snappy list --updates19:12
sergiusensjdstrand: cat /boot/uboot/snappy-system.txt | pastebinit.*19:12
mvothanks sergiusens19:13
jdstrandsergiusens: right, but autopilot is setting shutdown19:13
sergiusensmvo: I can't know for sure for what! :-)19:13
mvosergiusens: I'm sure you know plenty of good reasons19:13
mvosergiusens: but mostly for debugging why its showing that it needs to reboot when it does not19:14
mvoI thought we had this fixed *loooong* ago :/19:14
jdstrandsergiusens: http://paste.ubuntu.com/11437898/19:14
jdstrandI'm doing snappy update manually now19:14
sergiusensmvo: me too, but I suspect jdstrand is on some weird image ;-)19:14
mvowe also need uEnv.txt I think19:14
sergiusensmvo: boot logic is all in snappy-system.txt, uEnv.txt is just for enablement19:15
mvosilly me, indeed19:15
sergiusensjdstrand: what about snappy list --updates ?19:15
jdstrandsergiusens: it said I needed to update to 6919:17
jdstrandI guess I need to reflash it19:17
jdstrandsergiusens: manually upgrading libseccomp didn't help19:18
jdstrandsergiusens: so, webdm isn't running under seccomp:19:19
jdstrand$ cat /var/lib/snappy/seccomp/profiles/webdm_snappyd_0.719:19
jdstrand@unrestricted19:19
nothaljdstrand: No such command!19:19
ogra_lol19:19
jdstrandor at least, it shouldn't be19:19
sergiusensjdstrand: right, so could it be a kernel namespace issue? I'm just throwing out ideas, this isn't my domain at all19:21
rsalvetihow could the hwcaps be wrong19:21
ogra_they arent wrong, you just cant access them19:22
rsalvetiright, I mean, wrong from go's perspective19:22
sergiusensrsalveti: ogra_ they aren't wrong as this works fine when launched without the core launcher19:23
ogra_yeah, i think seccomp just blocks the syscall19:23
rsalvetisure, it's what ogra said, it probably just can't access it19:23
jdstrandsergiusens: we aren't using namespaces to any significant degree yet-- there is the new launcher work that adds the bit for /tmp19:23
sergiusensogra_: as jdstrand reminded me, it is @unrestricted19:24
jdstrandbut that shouldn't be on my image19:24
ogra_hmm19:24
jdstrandseccomp would kill the process and log a denial if it was it. however, there is no denial and it is @unrestricted19:24
ogra_and does @unrestricted also actually mean unrestricted ? ... unconfined on the phone doesnt necessarily mean completely unrestricted19:24
jdstrandsergiusens: fyi, I tried adding "GOARM=7" to the service file manually and it didn't make a different19:25
jdstranddifference19:25
jdstrandlet me try something else19:25
sergiusensjdstrand: that's a compile time thing19:25
sergiusensjdstrand: http://bazaar.launchpad.net/~snappy-dev/webdm/trunk/view/head:/build.sh#L3719:26
jdstrandsergiusens: ok, I took the launcher out of it by using: http://paste.ubuntu.com/11438058/19:27
jdstrandnow, I will take AppArmor out of it19:27
rsalvetiit finds the hwcaps by using the elf auxiliary vectors19:28
rsalvetihttp://articles.manugarg.com/aboutelfauxiliaryvectors.html19:28
ogra_ah19:29
ogra_it was /proc/$pid/auxv19:29
rsalvetiit can still use that19:29
rsalvetihttp://ffmpeg.org/doxygen/trunk/arm_2cpu_8c_source.html19:29
rsalvetilike ffmpeg19:29
rsalvetibut you can also just use the elf auxiliary vectors19:29
rsalvetihttps://wiki.linaro.org/Resources/HowTo/DeterminingCPUFeatures19:30
rsalvetiexplains it nicely19:30
jdstrandok, if I use this, it worked: http://paste.ubuntu.com/11438101/19:30
jdstrandlet me try one more thing19:30
sergiusensjdstrand: so no apparmor and no core launcher work19:31
sergiusensjdstrand: leaving apparmor and using your ExecStart also works fine19:32
jdstrandsergiusens: I'm ruling out the launcher now19:32
sergiusensbut I guess core launcher attaches the apparmor profile19:32
jdstrandit does19:32
jdstrandI am using some hackery to test with unconfned19:32
jdstrandI can say that there are no explicit deny rules in the webdm profile19:33
jdstrandif this comes done to kernel rate limiting I am going to strangle someone19:33
rsalvetiLD_SHOW_AUXV=1 exports the hwcap19:33
* jdstrand shakes fist at kernel rate limiting19:33
rsalvetiis there a way to export that when running it and get the output?19:33
sergiusensheh, right, forgot about the rate limiting issues when we started on the phone19:33
sergiusensrsalveti: yeh, in the systemd unit19:34
* sergiusens tries19:34
ogra_in the environment of the systemd unit19:34
jdstrandsergiusens: fyi, sergiusens unsurprisingly, this worked too: http://paste.ubuntu.com/11438162/ (after I created /var/lib/snappy/seccomp/profiles/unconfined)19:36
sergiusensjdstrand: so unconfined seccomp and no apparmor works fine with the core launcher19:38
jdstrandsergiusens: yes, the launcher is ruled out19:43
sergiusensrsalveti: btw AT_HWCAP:        half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd3219:53
sergiusensrsalveti: this env var breaks the magic bin thing though ;-)19:53
rsalvetisergiusens: yeah, that's correct19:55
rsalvetiit's looking for vfpv319:55
rsalvetiand vfp19:55
rsalvetinow why the hell go is not able to find that from the elf auxiliary vectors19:56
sergiusensrsalveti: it is19:56
sergiusensrsalveti: as I said, when running without our confinement it works fine (seccomp/u-c-l/apparmor)19:56
sergiusensalthough u-c-l and seccomp have been discarded as the problem19:57
jdstrandok, so I disabled rate limiting19:57
jdstrandsudo sysctl -w kernel.printk_ratelimit=019:57
sergiusensah, that's how it was done!19:57
sergiusensjdstrand: I don't see any denials here still19:58
* sergiusens imagine I used proper grammar19:59
sergiusensmeh19:59
sergiusensfriday19:59
ZwanHi20:10
Zwanthis seems like a good place to get some info about Snappy.20:11
ZwanDon't worry, I'm not seeking tech support.20:11
ZwanIs Snappy something that's going to completely replace apt-get in future releases or is it just going to be part of a sideproject thing?20:12
sergiusensZwan: ubuntu core will use snappy to drive it's package management as one of the things it does20:12
sergiusensjdstrand: do you think something in the profile itself it wrong and the parser just let's it through?20:13
ZwanAh, okay. So average Ubuntu desktop people won't have to worry about losing apt-get...20:13
ZwanWhew.20:13
jdstrandok, I ruled out systemd20:17
jdstrandsergiusens: unlikely. the parser would bail if it couldn't compile it20:17
jdstrandthere could be a parser bug, but let me keep trying some things20:17
jdstrandI found the issue20:21
jdstrandsergiusens: ^20:21
jdstrand  # snappy unpack20:21
jdstrand#  /usr/bin/snappy                                                 Uxr,20:21
jdstrand  /usr/bin/snappy                                                 uxr,20:21
sergiusensoh man20:22
sergiusenss/u/U/20:22
sergiusensjdstrand: right?20:22
* sergiusens does a bzr log/blame to figure out when this changed20:23
jdstrandsergiusens: see man apparmor.d 'ux - Unconfined execute mode'20:23
jdstrandsomething is getting scrubbed out that snappy needs20:24
jdstrandand ux prevents that from happening20:24
sergiusensjdstrand: hmm, I wonder how this workds on kvm though20:24
sergiusensas in amd6420:24
rsalvetiwell, no cpu type check20:25
sergiusensright20:25
rsalvetiit wouldn't cause any issue there20:25
sergiusensright as well20:25
rsalvetilove typos20:25
jdstrandjjohansen may be able to comment, but the secure exec stuff is used (the same as for setuid binaries) and perhaps there is a difference on arm and amd64 kernels20:26
rsalvetibut that was done on purpose I guess20:26
sergiusensrsalveti: it was U on purpose though20:26
jjohansenjdstrand: that will only get logged if debug is enabled, basically you will get a dmesg that the environment is being scrubbed on exec20:26
jdstrandoh, interesting20:26
jdstrandlet me try that20:26
jdstrandI hadn't gotten to setting debug=1 yet20:26
jjohansenso secure exec clears out a whole bunch of dangerous environment stuff, that ld uses and can be used to exploit the system20:27
rsalvetiright20:27
jjohansennot having those cleared is a BIG red flag20:27
rsalvetithat might effect the elf auxiliary vectors?20:27
jjohansenyes20:27
jdstrandit is interesting that this is a go, static executable20:27
rsalvetithere you go then20:27
jjohansenrsalveti: apparmor is not in control of what gets cleared, it just sets the flag and then the loader associated with the application actually does the env scrubbing, so normally its a glibc thing but it could be something else depending on the executable20:29
jjohansenjdstrand: even static executables have their startup loader stuff that is linked in20:29
rsalvetiright20:29
rsalvetiglad we know what is the problem now20:30
jdstrandso, with debug=1, I'm not seeing what is scrubbed, just that stuff is scrubbed20:30
jdstrandMay 29 20:29:59 localhost kernel: [ 6004.539676] AppArmor: scrubbing environment variables for /bin/mountpoint profile=unconfined20:30
jdstrandwe do know the problem and the shorterm fix20:30
rsalvetigreat20:30
rsalvetiship it20:30
sergiusensjdstrand: I guess I see it on arm and not amd64 as the binary is cross compiled for arm and locally (arch) compiled for amd6420:30
jdstrandbut I wonder if this is going to bite us again down the line for normal or framework apps20:31
jdstrandgranted, we use ix for apps20:31
rsalvetisergiusens: shouldn't make a difference20:31
jdstrandand Ux is a big red flag too20:31
rsalvetiit's just that amd64 is not checking for the same thing20:31
jdstrandso we wouldn't normally allow that20:31
jdstrandI can see frameworks (and even webdm) using Cx though20:32
sergiusensjdstrand: this is legacy to what we did in capetown in december though20:32
sergiusensjdstrand: any alternative? I don't mind doing the right thing now20:32
jdstrandsergiusens: I'm not sure what you mean by legacy. webdm is fork/execing /usr/bin/snappy20:33
sergiusensjdstrand: legacy as this profile piece was written when we were in capetown20:33
jjohansenjdstrand: Ux, Cx, Px are the "safe" environment scrubbing variants, its ux, cx, px that don't scrub the env20:33
jdstrandsure, I get that20:33
jdstrandbut it is still applicable :)20:33
jdstrandjjohansen: yes20:33
jjohansenso it looks the opposite this is failing because something isn't getting scrubbed out20:34
sergiusensjdstrand: in any case once we move to the rest api being on snappy itself, we only need to worry about connecting to a unix socket20:34
jjohansen(01:21:45 PM) jdstrand: #  /usr/bin/snappy                                                 Uxr,20:34
jjohansen(01:21:45 PM) jdstrand:   /usr/bin/snappy                                                 uxr,20:34
jdstrandjjohansen: hmmm? Ux didn't work, ux did20:34
jjohansenthat was the change causing the problem? correct?20:34
jdstrandjjohansen: no, that was the 'solution'20:34
jjohansenoh that was the fix, sorry misinterpretted and got very confused20:34
jdstrandsergiusens: when is that api coming?20:35
sergiusensjdstrand: this cycle20:35
jdstrandsergiusens: alright, well let's just let the ux ride then. we can revisit proper confinement at that time20:36
sergiusensjdstrand: I was supposed to be working on that today fwiw20:36
jdstrandI was supposed to be working on things today too :P20:36
jdstrandah well :)20:36
sergiusensjdstrand: many of these issues will go away; maybe you can easy prof a reserved "device_management" stanza ;)20:37
jdstrandI thought we did that :)20:37
jdstrandhardware assign ftw20:37
jdstrandanyhoo, yeah, always more to think about20:37
sergiusensjdstrand: heh; was thinking more a layer above "device" as in the product/box20:38
sergiusensjdstrand: anyways, thanks, testing now20:38
jdstrandsergiusens: fyi, you should probably try to get seccomp as restricted20:41
jdstrandthough, it would need som significant tuning20:42
sergiusensjdstrand: sure, any pointers on how to get started on that side20:42
jdstrandsergiusens: copy the syscalls from hello-world.env from /var/lib/snappy/seccomp/profiles and start there20:43
sergiusensjdstrand: ok, and iterate with sc-log.* ?20:43
jdstrandsergiusens: yes20:43
sergiusensjdstrand: got it; I'll get to it just for the excercise of getting familiar with this20:44
sergiusensI suspect again that moving to this rest api will move most of it away20:44
jdstrandcool20:44
jdstrandsergiusens: what is the design for the rest api? right now I see that the web interface is confined by this profile, and this profile allows a whole-lotta privilege. eg, if an attacker could take control of webdm, he could install a malicious snap with no confinement that provides a remote shell20:46
jdstrand(via side loading)20:46
jdstrandsergiusens: perhaps this is something that you would want to spec out with the security team and architects team?20:47
sergiusensjdstrand: the rest api would look a lot like lxd's but yeah, I have to get the proposal and send out for review20:47
sergiusensjdstrand: I bet you guys will be an integral part of it20:47
jdstrandit might be that there isn't a terribly whole lot we can do here since this is a management interface that is designed to, well, manage. but perhaps we can have some security in depth here20:48
jdstrandsergiusens: ok, cool20:48
sergiusensjdstrand: this is where the macaroons come into place, I think lool has the high level architecture in his head already and waiting for some minion like me to do a brain dump for him :-)20:50
jdstrandah20:50
loolhaha20:50
jdstrandtyhicks, mdeslaur (and jjohansen): we should be looking out for this ^ (see backscroll for 7 minutes)20:51
tyhicksjdstrand: ack20:52
lool(so every time I read minions, of course I try to think of despicable me, but I can't stop thinking about Mignons which was means "cuties" but were also the "favorites" of the prince)20:53
lool(the king would allow them to dress as nicely as him, wear facial powder etc., and at some point it gained an homosexual connotation)20:53
jjohansenjdstrand: ack20:53
looljdstrand: so my understanding is that secure channel is laptop -> my.ubuntu.com + snappy device -> my.ubuntu.com; either we then do direct connection to snappy device with a cookie with limited powers, or we go over my.u.c to do everything or a mixture of both20:56
* sergiusens doesn't want to spread facial powder over his face20:56
loolbut TBH, while I find macaroons and this bootstrap of the security story exciting, I suspect folks in Online Services are better clued at these topics20:57
sergiusensrsalveti: mind taking action? https://code.launchpad.net/~sergiusens/webdm/profileUnconfinedNoScrubSnappy/+merge/26062520:57
loolsergiusens: you can be my mignon de couchette20:58
loolyou would be allowed to sleep in the same room as me20:58
loolhttp://fr.wikipedia.org/wiki/Mignon_%28histoire%29 for the full story -- yes, this is an actual expression20:58
sergiusenslool: lol20:59
* lool now expects an email from HR20:59
sergiusenslool: lol at that again!20:59
sergiusensjdstrand: or maybe you can https://code.launchpad.net/~sergiusens/webdm/profileUnconfinedNoScrubSnappy/+merge/260625 stamp this?21:03
jdstrandsure21:08
rsalvetisergiusens: jdstrand did already it seems21:32
rsalvetiwas walking the dog21:32
Chipacasergiusens: any progress with the mystery of the mysterious disappearing floating point?21:51
rsalvetiChipaca: https://code.launchpad.net/~sergiusens/webdm/profileUnconfinedNoScrubSnappy/+merge/26062522:37
rsalvetithat made go not being able to find out the hwcaps via elf auxiliary vectors22:37

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