/srv/irclogs.ubuntu.com/2015/07/31/#snappy.txt

pilil__good morning.04:02
pilil__I have a question about system wrappers. After installation all apps and services should be started only through wrappers, but when one wrapper trying to launch another wrapper I receive errors like this:04:02
pilil__$sudo /usr/bin/ubuntu-core-launcher myapp myapp_service_0.0.1 /apps/myapp/0.0.1/bin/myapp-wrapper04:02
pilil__ubuntu-core-launcher: error while loading shared libraries: cannot apply additional memory protection after relocation: Permission denied04:02
pilil__even with frameworks04:03
pilil__without ubuntu-core-launcher - everything ok04:05
pilil__Is there proper way to launch one file from another?04:07
dholbachgood morning07:00
fgimenezgood morning07:03
elopiofgimenez: crazy day here today, but all your branches are +1-ed. Sorry for the delay.07:18
fgimenezelopio, hey, np thanks :)07:18
fgimenezelopio, i'll apply your suggestion to the config testbed one, i like the boolean value option07:19
elopiofgimenez: as you prefer. The change would be pretty simple, so if it passes for you also feel free to top-approve.07:20
elopioI'm leaving now. See you soon.07:20
fgimenezelopio, ok see you07:21
=== erkules_ is now known as erkules
=== clobrano is now known as c-lob
ogra_pilil, this sounds like a question for the security team, either wait til the US gets up or write a mail to the mailing list08:17
longsleepMoin folks, so is there a place where i can add feature requests for snapcraft?08:20
ogra_file a whishlist bug08:20
ogra_und moin :)08:20
longsleepwhishlist bug ok - let me try that08:20
longsleephaha bug #5078808:22
nothalBug #50788: We don't need "Wishlist"  <http://launchpad.net/bugs/50788>08:22
ubottubug 50788 in Launchpad itself "We don't need "Wishlist"" [Undecided,Invalid] https://launchpad.net/bugs/5078808:22
ogra_lol08:22
ogra_reported 2006-06-23 :)08:23
longsleepyeah08:23
longsleepand marked invalid08:23
longsleepjust was the first hit08:23
ogra_man, these names bring back memories :)08:23
pililogra_, who should I ask it from security team?08:23
ogra_pilil, try jdstrand or tyhicks (i'm not sure who exactly could help here)08:24
pililogra_, I got it, thanks08:25
pililogra_, there is another question. How can we add new extrauser to Snappy, cause tools like passwd or useradd still works with /etc/passwd instead of /var/lib/extrausers?08:27
ogra_pilil, i think that is fixed in the rolling release, it is quite a change so it was not backported afaik08:29
longsleepogra_: bug #1480144 added, i tagged it with wishlist, not sure if that is the correct way08:29
nothalBug #1480144: Snapcraft should be able to run in clean environment with pbuilder/cowbuilder <Snappy:New> <http://launchpad.net/bugs/1480144>08:29
ubottubug 1480144 in Snappy "Snapcraft should be able to run in clean environment with pbuilder/cowbuilder" [Undecided,New] https://launchpad.net/bugs/148014408:29
pililogra_, thanks08:31
ogra_longsleep, i know cross building is planned, but it will likely still take a bit before it happens08:35
ogra_(not on top of the list)08:35
tasdomashi08:40
tasdomaswhy does the raspberry pi2 snappy image contain an .ssh/authorized_keys entry for ogra@anubis?08:41
ogra_tsthats a fake key ... ubuntu-device-flash needs a valid key if you enable --develper-mode during build08:45
ogra_tasdomas, ^^^08:45
ogra_tasdomas, i hope to finish a new image today and will make that clearer (calling it dummy@dummy or some such) in that build08:46
longsleepogra_: yeah - in the meantime i might just create a small tool "debsto08:49
longsleeperr08:49
longsleepogra_: debs2snap or something08:50
ogra_haha08:50
longsleepthat way i can just use the existing gear plus one extra step08:50
biezpalogra_, question about systemd and snaps. In the package.yaml we can specify the type of service (dbus or not), is there a plans to implement other types of services, like forking or other?08:56
ogra_biezpal, hmm, not sure what you mean by type of service ... do you mean the bus-name filed for framework snaps ?09:00
ogra_https://developer.ubuntu.com/en/snappy/guides/package-metadata/09:00
JamesTaitGood morning all; happy Friday, and happy System Administrator Appreciation Day! ๐Ÿ˜ƒ09:02
ogra_wasnt that yesterday ?09:03
ogra_oh, wasn't :P09:04
=== vrruiz_ is now known as rvr
biezpalogra_, I'm talking about systemd service unit Type09:14
biezpal[Unit]09:15
biezpalDescription=swamp services management service09:15
biezpalAfter=syslog.target09:15
biezpal[Service]09:15
ogra_hmm, then i dont see the relation to package.yaml here09:16
biezpalType=forking09:16
biezpalwe want to specify type of service described in package.yaml09:16
ogra_but package.yaml doesnt offer that (at least currently)09:16
biezpalwe can describe service from package.yaml, but not the type of it?09:17
ogra_you can put into the description what you want ... but there is no "type" field or anything that would do anything meaningful with it09:18
ogra_(see the linked documentation above)09:19
biezpalforked service is being killed by systemd because systemd is thinking that process is stopped09:20
biezpalnow, to get rid of it we are manually edit systemd unit and specify Type = forking09:21
ogra_righ09:21
ogra_t09:21
ogra_and where does the package.yaml come into play here ? thats the bit i dont understand09:22
biezpalwe want Type of service to be taken from package.yaml09:22
ogra_oh, so this is a feature request ?09:23
biezpalit's just a question to find the way09:23
ogra_(to extend package.yamnl ?)09:23
biezpalto build unit automatically with additional options09:24
c-lobsorry if I stick my nose in this discussion, but isn't it possible to pack the .service file into the snap?09:25
ogra_right, that doesnt sound like something supported yet ... i'd start a thread on the mailing list09:26
ogra_c-lob, indeed you can do that09:26
biezpalc-lob, where we can read about that option?09:27
c-lobbiezpal, well I'm just thinking about now :)09:27
c-lobbiezpal, well I'm just thinking about it now :)09:27
biezpallol09:27
biezpalogra_, maybe you know?)09:28
* ogra_ takes a look at webdm09:28
ogra_hmm, so i dont see a way, it uses the generated unit too (which fires up a script that cares for all teh rest). i guess you should try starting a thread on the ML09:32
ogra_(there is probably no way to change the type of the unit, but surely a way to achieve what you wanted to do with setting it via some other mechanism)09:33
vmayoralppisati: just e-mailed you, i'm experiencing some issues with the compiled kernels when booting with the Snappy FS, apparently the "system-boot" partition fails to get mounted. Would be great getting your input here09:38
ppisativmayoral: i'm looking09:40
vmayoralppisati: thanks09:40
ppisatimount: wrong fs type, bad o09:40
ppisatimissing codepage or helper09:40
ppisativmayoral: can you complete a boot?09:40
vmayoralppisati: i get into emergency mode https://gist.github.com/vmayoral/fc2c7ebbd679ea7d9a9b09:42
ppisativmayoral: do you see something in dmesg?09:43
ppisativmayoral: let me check the config09:43
vmayoralppisati: nothing relevant that i can identify https://gist.github.com/vmayoral/193f5c1e71f5cfb9bd6709:44
ppisatiFAT-fs (mmcblk0p1): IO charset iso8859-1 not found09:44
ppisatithat config is missing the option09:44
ppisatitwo things:09:44
ppisati1) did you check that the resulting config are the same?09:45
ppisati2) you are using an old version #18 while we are at...09:45
ppisati23?09:45
ppisatisomething like that09:45
ppisatilet me take a closer look at that tree09:45
ppisatiah09:47
ppisatiok09:47
ppisatito compile that tree and get a debian package, you have to do this:09:47
ppisatiexport $(dpkg-architecture -aarmhf); export CROSS_COMPILE=arm-linux-gnueabihf-09:48
ppisatifdr clean; debian/rules build; fdr binary-generic09:48
ppisatithe config is store in:09:48
ppisati*stored09:48
ppisatimaster/debian.master/config09:49
ppisatisplit among09:49
ppisaticonfig.common.ubuntu09:49
ppisatiand the other snippets in debian.master/config/armhf*09:49
ppisatiif you did as i read in the REAME.md of that git tree:09:50
ppisatiARCH=arm ./scripts/kconfig/merge_config.sh arch/arm/configs/omap2plus_defconfig arch/arm/configs/snappy/*.config09:50
ppisatimake ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtbs -j409:50
ppisatiyou are missing some options09:50
ppisatiso, it's up to you09:50
vmayorali see09:50
vmayoralregarding the kernel09:50
ppisatieither you add that charset in your config09:50
vmayorali fetched it from http://kernel.ubuntu.com/git/ubuntu/ubuntu-vivid.git/ a few days ago09:50
vmayoralwill rebase it now to get up to date09:51
ppisatii think your config is quite good09:51
ppisatithe way you build the kernel is correct09:51
ppisatiit is how it's done when you are developing09:51
ppisatiit's faster09:51
ppisatiit easier if you just made a change and you want to test it09:51
ppisatietc09:51
ppisatibut if you want exactly our kernel packages09:52
ppisatiyou should follow the 'fdr *' instructions up here09:52
ppisatiwhere fdr is an alias for09:52
ppisati'fakeroot debian/rules'09:52
ppisatijust in case09:52
vmayoralthanks a lot for explaining, is this documented somewhere?09:53
ppisativmayoral: yep09:53
ppisativmayoral: hold on09:53
ppisatihttps://wiki.ubuntu.com/KernelTeam/ARMKernelCrossCompile09:54
ppisatiok, this is a bit old09:54
ppisatisince it covers the omap4 kernel09:54
ppisatiand back then i was suggesting:09:54
ppisatiexport $(dpkg-architecture -aarmhf); export CROSS_COMPILE=arm-linux-gnueabihf-09:54
ppisatifakeroot debian/rules clean09:54
ppisatifakeroot debian/rules binary-omap409:54
ppisatibut the stuff that i pasted here is faster09:54
ppisatiand works for generic09:55
ppisati(instead of binary-omap4 you use binary-generic)09:55
ppisatiand it tells you how to change the config too09:55
ppisatifakeroot debian/rules editconfigs09:55
ppisatiin your case it's the generic flavour that you are interested09:56
vmayoralgreat, I'll go ahead and reproduce it all. If it adds some value, I'll be happy to document it  and maybe this way i can contribute.09:56
vmayoralppisati: thanks a lot for your time.09:57
biezpalogra_, thanks for answer10:00
vmayoralppisati: it'll be great if you guys could also consider including the PRU patches in the vivid tree. Many BBB users make use of these units on the SOC.10:02
vmayoralalso, ppisati, what's you opinion on changing the kernel released on snappy images to be preemptible (pretty match activating the PREEMPT option)?. IOT devices could make good use of this kind of kernels10:04
ppisativmayoral: ATM the BBB is the same kernel that we use across all ubuntu armhf devices10:05
vmayoralcurrent OEM snap allows to change the kernel (i believe) so that should be manageable10:05
ppisativmayoral: but we are having a discussion about it, where to take it, the direction we want to give it, etc10:05
ppisatiright10:05
ppisativmayoral: question - i now that you use the PRUs for the sensors on your drone, right?10:06
vmayoralppisati: great hearing that. I don't mind compiling the kernels with PREEMPT or PREEMPT_RT options but it'll be great for many avoiding this and going straight into the official images10:06
vmayoralppisati: yes, we use it for fast PWM generation and PPM signal processing10:06
ppisativmayoral: ok10:07
vmayoralbut there's a lot happening in the PRU world10:07
ppisativmayoral: so, you load a binary into PRUs, right?10:07
vmayoralyes, every year, there're GSOC project that build on top10:07
ppisativmayoral: did you try to "port" your code to the remoteproc facility?10:07
vmayoralno we have not. What i'm most concerned about is the maintainability if we were to do so.10:08
vmayoralCurrent Dronecode Foundation helps a lot with that10:08
vmayoralif we were to move to the PRUs...10:08
ppisativmayoral: what you mean?10:08
vmayorali mean that there's an existing community supporting the code based on a single (or multiple) core symmetric processors based on userspace drivers. If we were to port a  part of the code to an assymetric arch. (e.g. the PRUs) we would loose the community support10:11
vmayoralwith our current size and dev. force we can't afford it10:11
vmayoralnevertheless, i'm seeing how the PRU-world grows every year and there's even people bit-banging protocols on them10:12
ppisativmayoral: ok, sorry i'm confused now10:13
ppisativmayoral: i asked you if you were using the PRU and you told that you were using it10:13
ppisati12:06 < vmayoral> ppisati: yes, we use it for fast PWM generation and PPM signal processing10:14
vmayoralyes, we are10:14
vmayoralfor PWM and PPM generation/processing10:14
ppisatiok10:14
vmayoralprobably i misunderstood it at some point.10:14
ppisativmayoral: so, there's are two ways to interact with the hw PRUs AFAIK10:15
ppisativmayoral: the PRU patches that you applied10:15
ppisativmayoral: unsupported by TI10:16
ppisativmayoral: of their supported mechanism, the remoteproc10:16
ppisati*or10:16
ppisatisince you applied thse patches to your kernel, i assume you are using the userspace driver10:16
ppisatiand i was wondering if you have ever tried/considered to move it to remoteproc10:17
ppisatithat's beause, part of the TI BSP kernel requires the remoteproc facility for some of its features10:17
ppisatie.g. the power management code has a requirement on it10:17
vmayorali see, i don't have much understanding about how remoteproc works but i was assuming that any interaction with the PRUs was done through the remoteproc framework.10:21
vmayoralthe patches came originally from a tree maintained by Robert Nelson who is working tightly with TI and BeagleBoard https://github.com/RobertCNelson/bb-kernel/tree/am33x-rt-v4.1/patches/pru10:22
vmayoral(AFAIK)10:24
=== andyrock_ is now known as andyrock
longsleepis there a way to launch a shell in the environment of a snap?10:52
longsleepmy snap fails to start, and the systemd log is not very helpful10:53
ogra_i had a nodejs based terminal once, running the shell inside teh snap env,  but the snap isnt functional currently10:54
ogra_i think there was another one in the examples or some such, but i cant remember exactly10:55
longsleepwell i guess i could just set the environment variables manually10:55
ogra_do you have a start script ?10:56
ogra_you could just make it print the env to some logfile10:56
longsleepyes10:56
longsleepaha10:56
longsleepthe error is cp: cannot create regular file โ€˜/server.confโ€™: Read-only file system10:56
ogra_looks like an unset variable10:57
ogra_SNAP_APP_PATH ?10:57
ogra_or SNAP_APP_DATA_PATH10:57
longsleepyes CONF=$SNAP_APP_DATA_PATH/server.conf10:57
ogra_weird, that should definitely be set10:58
longsleepyes it is not set when i run it manually10:58
longsleepfor testing10:58
longsleepfound the error now10:58
ogra_heh, indeed not10:58
longsleepsed: -e expression #1, char 88: unterminated `s' command10:58
longsleepnarf10:58
ogra_heh10:58
longsleepbut it would be really helpful if one would see these errors in systemd10:59
ogra_+110:59
ogra_they used to show up when we used journald ... not sure why they dont end up in syslog now11:00
longsleepmhm let me check syslog, i was using systemctl11:01
ogra_ah11:01
longsleepogra_: you are right, it is in syslog11:04
longsleepJul 31 11:04:22 odroid ubuntu-core-launcher[1327]: sed: -e expression #1, char 88: unterminated `s' command11:04
longsleepthats good enough i think11:05
ogra_ah, cool11:05
Chipacalongsleep: should also be in journalctl11:05
ogra_Chipaca, do you knwo why we use both ?11:06
Chipacabut i admit to not being proficient in journalctl usage11:06
ogra_smells bloated11:06
Chipacaogra_: because that's how we roll? :-p11:06
Chipacaogra_: i think we want to drop syslogd, but had to bring it back for <something>11:06
Chipacahappened before i got on board11:06
ogra_ah11:06
Chipacaogra_: but aiui it's wanted to go away11:06
ogra_ok11:06
Chipacathat is, we want to drop syslogd, but something or other depends on it still11:07
* ogra_ doesnt care which one goes away, i just dont like the duplication :)11:07
Chipacaand it's bloated but not super critical11:07
ogra_yeah11:07
ogra_hmm11:09
ogra_on my BBB snappy list -v shows ubuntu-core 9 active ... webdm only shows 811:10
longsleepmhm now i get Jul 31 11:12:02 odroid ubuntu-core-launcher[1734]: Bad system call when running sed :/11:14
longsleeptime for lunch11:14
Chipacalongsleep: ooh! check syslog again, in particular for seccomp or apparmor issues11:23
Chipacalongsleep: bad system call is probably seccomp11:23
Chipacalongsleep: sc-logresolve should help you if that's the case11:24
Chipacalongsleep: super interested in what you find11:38
Chipacabut alas, lunch calls11:38
=== JamesTai1 is now known as JamesTait
=== guest42345 is now known as guest00|AFK
longsleepChipaca: yeah i will investigate now - i just returned from lunch and finishing up my ice cream :P12:25
ogra_yummy12:28
* Chipaca having a big cool fizzy drink instead12:28
Chipaca(no it's not beer, shaddup)12:28
* ogra_ slurps a hot espresso :) 12:29
ogra_you and your frozen stuff12:29
longsleepChipaca: so, this is all in syslog: http://paste.ubuntu.com/11973062/12:43
longsleepChipaca: and my start script is this (for testing) http://paste.ubuntu.com/11973068/12:43
jjohansensergiusens, ogra_: how do you build a base image with a custom kernel using ubuntu-device-flash?12:56
ogra_you need your own device tarball12:57
ogra_jjohansen, this is the script i use to create the rpi device tarball from ppisati's PPA builds http://paste.ubuntu.com/11973145/12:59
jdstrandogra_: how much of that applies to generating something for generic-amd64?13:00
ogra_well, the format is the same in both13:00
ogra_the paths might differ though13:01
ogra_(since x86 doesnt use uboot indeed)13:01
c-loblongsleep, I saw that calling the binary directly from its folder (like /apps/appname/ver/binary) give more information than "bad system call"13:01
jdstrandI saw dtb too13:02
longsleepc-lob: all right13:02
ogra_jdstrand, jjohansen, you can ignore the System.-map, config and dtb stuff though13:02
longsleepc-lob, Chipaca : I narrowed it down to  the -i parameter in sed. sed works just fine without -i13:02
Chipacaoops, missed your syslog13:03
Chipacasorry was pulled into a different thing13:03
* Chipaca reads now13:03
longsleepChipaca: yeah there is not much in syslog13:03
longsleepc-lob: no further details with callling /bin/sed instead just sed13:03
Chipacalongsleep: and sed -i works outside of a script?13:03
longsleepChipaca: when i run it as root yes13:04
longsleeplet me try again13:04
Chipacajdstrand: an idea what can cause a silent "bad system call" with nothing in syslog, when running something as root under seccomp, but not when running as root wihtout it?13:05
pililjdstrand, can you help me with question about system wrappers? After installation all apps and services should be started only through wrappers, but when one wrapper trying to launch another wrapper I receive errors like this:13:05
longsleepChipaca: yes confirmed, sed -i works fine as root13:05
pilil$sudo /usr/bin/ubuntu-core-launcher myapp myapp_service_0.0.1 /apps/myapp/0.0.1/bin/myapp-wrapper13:05
pililubuntu-core-launcher: error while loading shared libraries: cannot apply additional memory protection after relocation: Permission denied13:05
pilileven with frameworks, without ubuntu-core-launcher - everything ok. Is there proper way to launch one file from another?13:05
Chipacapilil: i don't think you should call one wrapped thing from another13:06
Chipacainside the same app, call your things directly13:07
Chipacaoutside the same app yes13:07
jdstrandpilil: Chipaca is right. if it is in your own snap, just use $SNAP_APP_PATH/path/to/your/thing13:07
Chipaca*gasp*13:07
* Chipaca takes a snapshot and frames it13:08
pililChipaca, if I have framework LXC, how could i run commands like lxc-ls from my app?13:08
jdstrandChipaca: it was bound to happen sometime13:08
jdstrand</rimshot>13:08
* jdstrand hugs Chipaca :)13:08
jdstrandpilil: the framework has to expose that via its framework policy13:08
Chipaca:)13:09
jdstrandpilil: so install the framework, then you can do 'snappy-security list'13:09
jdstrandpilil: then have your snap depends on the framework and use either the security-template or caps (for policy groups), or both in your yaml for the service/binary13:10
jdstrandChipaca: yeah, that is one strange error13:11
pililjdstrand, even if policy set up to unconfined, we have this error. Or there are some other policy?13:11
jdstrandChipaca: (Bad system call). that isn't a seccomp denial13:11
jdstrandpilil: if the policy is unconfined, don't use a wrapper, just go into the install directory of the the you want to execute13:12
jdstrandpilil: /apps/foo/current/path/to/binary13:12
Chipacalongsleep: do you still get it if you set your policy to unconfined?13:12
jdstrandChipaca: that feels like the launcher was compiled on one system that had that system and run on another that didn't13:13
longsleepChipaca: how would i do that? Didnt investigate on policies yet13:13
pililjdstrand, yes, now we deal with this way, but its look insecure, and we are researching how to improve security13:13
jdstrands/that system/that system call/13:13
longsleepChipaca: i have caps: networking and network-service13:13
jdstrandpilil: well, you are running unconfined so... :)13:13
jdstrandpilil: when you go confined, use the framework policy method I described13:13
pililit was just first run, we have plans to use profiles :)13:14
longsleepChipaca: from my syslog, does it not already run with unconfined?13:14
longsleepChipaca: operation="profile_replace" profile="unconfined"13:14
jdstrandpilil: a framework will express what it is safe to do via its framework-policy13:14
pililjdstrand, thanks, now I need addition research about it13:15
Chipacalongsleep: no, I don't think that's your app there13:15
jdstrandpilil: fyi, https://developer.ubuntu.com/en/snappy/guides/frameworks/ and https://developer.ubuntu.com/en/snappy/guides/security-policy/13:16
longsleepChipaca: its not - but it has name="spreed-webrtc.sideload_spreed-webrtc_0.0.1" pid=1718 in the line?13:16
pililjdstrand, yeah, already there, thanks13:16
Chipacalongsleep: yes; I don't know what that means (jd.strand would know), but i do know that unless you're specifying unconfined in your package.yaml, it'll be confined13:17
jjohansenogra_: I am afraid I am missing some context to get that scipt to work for me. I assume you have mounted the image and are in its root?13:18
longsleepChipaca: so i just add security-template: unconfined ?13:18
ogra_jjohansen, no13:18
ogra_jjohansen, i create a device tarball fs structure and tar that up after putting the files in place13:19
ogra_jjohansen, then you use it with ubuntu-device-flash to create an image (with the --device-tarball option pointing to it)13:19
jdstrandlongsleep: yes13:19
longsleepChipaca, jdstrand: When running unconfined it just works13:19
jdstrandlongsleep, Chipaca: the STATUS line is just telling you that the profile was reloaded into the kernel13:20
Chipacata :)13:20
Chipacai knew it was an irreal elephant, but not exactly why13:20
longsleepso, but this cannot be the solution right?13:20
Chipacanope13:20
longsleepi mean we do want to run things confined13:20
Chipacajdstrand: is there an easy way for longsleep to run the service confined, but via strace?13:21
longsleepwell there is no strace in my snappy13:21
Chipacalongsleep: you can copy strace-the-binary from ubuntu and it'll work13:21
longsleepRight, assuming i find an armhf one somewhere - let me look13:22
Chipacaheh13:22
Chipacayou don't have an armhf notebook?13:22
Chipaca;-p13:22
Chipacalongsleep: i can put one up for you, give me a bit13:22
Chipacalongsleep: you based on 15.04?13:22
jdstrandChipaca: look at the line in the systemd service file for the launcher and do 'sudo strace -o /tmp/strace.out -f ubuntu-core-launcher ...'13:22
jjohansenogra_: device-tarball is only available for touch, I am trying to do core?13:23
Chipacajdstrand: or edit the start script similarly :)13:23
Chipacagood one13:23
jjohansenogra_: can I just use touch instead of core?13:24
Chipacanot the start script, the systemd file13:24
jdstrandChipaca: well, the start script will run strace under confinement. the way I described strace will be out of confinement13:24
Chipacajdstrand: yep yep13:24
jdstrandboth can be useful13:24
longsleepChipaca: yes 15.0413:24
Chipacajdstrand: last i tried, strace wouldn't play well seccomp13:24
jdstrandso, the service probably needs to have the cd to the WorkingDirectory and the env setup to what is in Environment13:24
jjohansenChipaca: strace should work with seccomp, if seccomp allows ptrace13:25
jdstrandChipaca: yeah, to run strace under confinement the security policy would have to be modifed, which took us out of 'an easy way' :)13:25
jdstrandChipaca: I mean, I could get you there... :)13:25
Chipacajjohansen: jdstrand: after my holidays, i'll try strace under seccomp13:26
longsleepChipaca: ok i got strace, hold on a sec13:26
* Chipaca makes a note13:26
ogra_jjohansen, sorry, --device-part= for core ... not -tarball13:26
Chipacalongsleep: ah, ok :)13:26
* Chipaca had just found it13:26
Chipacahttp://people.canonical.com/~john/strace_4.8.1ubuntu5_15.04_armhf fwiw13:28
Chipacalongsleep: you know what to edit to use that?13:28
jjohansenogra_: what is the best way to mount these images, last touch images I mount were fine, these core images fail13:29
jdstrandChipaca: for your after holidays notes> you can just drop syscalls into /var/lib/snappy/seccomp/profiles/foo. I have a feeling you'll need something for apparmor too (a simple '/path/to/strace' ixr,' and 'ptrace,' in /var/lib/apparmor/profiles/...  would probably get you very close)13:29
sergiusensjjohansen: https://github.com/longsleep/snappy-odroidc#build-snappy-image-for-odroid-c113:29
sergiusensjjohansen: kpartx -avs img.img; mount ...; umount ...; kpartx -ds img.img13:29
jjohansensergiusens: hrmm okay, maybe I have a corrupted image13:30
longsleepwell .. Jul 31 13:30:10 odroid ubuntu-core-launcher[2762]: /apps/spreed-webrtc.sideload/0.0.1/bin/strace: test_ptrace_setoptions_for_all: unexpected signal 3113:30
jjohansensergiusens: thanks13:30
longsleepChipaca: did i do something wrong or strace does not work13:30
Chipacalongsleep: what did you edit?13:30
sergiusensjjohansen: parted on the img file might tell yo, but if it's x86, it should have 5 partitions13:31
longsleepmy start script13:31
longsleepChipaca: so i have a strace line now in the start script for sed13:31
Chipacalongsleep: ah. no :) edit your systemd service file13:31
Chipacalongsleep: /etc/systemd/system/somethingobvious13:31
longsleepah ok13:31
Chipacalongsleep: and may i recommend strace -s 999 -f -o /tmp/mytrace13:32
Chipacaand then the launcher13:32
Chipacai.e. strace -s 999 -f -o /tmp/mytrace ubuntu-core-launcher yadda yadda13:32
* Chipaca notes signal 31 is USR213:33
longsleepChipaca: all right http://paste.ubuntu.com/11973341/13:34
longsleepoh i didnt at the parameters13:34
longsleephold on13:34
longsleepChipaca: and here it comes: http://paste.ubuntu.com/11973352/13:36
jdstrandlongsleep: can you paste 'sudo grep audit /var/log/syslog'?13:39
longsleepsure13:39
longsleepjdstrand: http://paste.ubuntu.com/11973370/13:40
Chipacajdstrand: nothing strange there, amirite?13:42
Chipacai think this needs to go to a bug13:42
Chipacai'll see if i can reproduce it, then file it myself13:42
Chipacameanwhile, longsleep, you could do http://pastebin.ubuntu.com/11973383/13:43
longsleepChipaca: yeah it could be related to my kernel as well13:43
Chipacalongsleep: avoid an extra exec, and an extra file move :)13:43
jdstrandChipaca: yeah, there is no seccomp denial13:43
longsleepChipaca: yes sure, i can go without -i13:43
Chipacalongsleep: you know -i isn't *actually* in place, yes?13:44
Chipacait creates a tmpfile then moves it over13:44
longsleepChipaca: yes - it creates a tmpfile13:44
Chipacaso your .new was dupe effort13:44
longsleepi see those by the way13:44
Chipacayep, see it in strace too13:44
jdstrandogra_: so, in thinking about it, there is no reason why in an generic-amd64 vm jjohansen can't just remount rw, put the kernel wherever grub is looking for it, remount ro and reboot, right?13:55
ogra_jdstrand, yeah13:55
jdstrandok cool :)13:55
ogra_i thought he wanted to build an image13:55
ogra_sorry, i misunderstood that13:55
jdstrandwell, that was the question posed to you, but the motivation was to test a debug kernel13:55
Chipaca:)13:56
jdstrandbut now we have all this very interesting information that will just go away once kernel snaps are implemented :)13:56
ogra_yeah, for that you can just cp ... but be careful with modules ;)13:56
ogra_(initrd side specifically)13:57
jdstrandknowing jj, he isn't changing abi for what he is looking at, but note taken13:57
jdstrandjjohansen: ^13:57
jdstrandjjohansen: I suppose I should be the one to apologize for not thinking of the cp into place sooner :)13:58
jjohansenwell, uh that would be nicer if it was the same kernel version13:59
jjohansendon't ask13:59
=== alex_abreu is now known as alex-abreu
jdstrandheh, well then yes, take ogra_'s point to heart I guess :)14:00
ogra_not sure if/which modules are needed on x8614:01
ogra_perhaps it just works, else you need to repack the initrd (try if update-initramfs works)14:01
jjohansenit appears too14:05
jjohansenso I am in for some manual copying fun14:05
elopiohello!14:07
longsleepChipaca: well i hit the next obstacle: openssl rand -hex 32 yields openssl: Operation not permitted14:10
Chipacalongsleep: sudo tail -n 100 /var/log/syslog | grep audit ?14:11
jdstrandthat is certainly an apparmor denial14:11
longsleepChipaca: http://paste.ubuntu.com/11973546/14:13
ChipacaDENIED14:13
longsleepnot sure if that is related14:13
ChipacaI always read that in the quake voice14:13
jdstrandwe don'twe don't allow ixr on the openssl binary. that is arguably a bug. on the one hand, it is in the platform and it is safe security wise to allow. on the other hand, it is in the platform and it adds a potential coupling to a specific ubuntu release (ie, we could update openssl and break people)14:14
longsleepmhm net_admin and block_suspend?14:14
Chipacajdstrand: how can updating openssl break people? is the output different release on release?14:15
jdstrandChipaca: we could drop an antiquated cipher14:15
Chipacalet's not ship antiquated ciphers in the first place! /s14:16
longsleep:D14:16
longsleeptoo late for that14:16
jdstrandmind you, I am speaking theoretically from the pov that has been expressed that we should only allow the minimum platform deps14:16
ogra_hey ! what about us patina fans !!14:17
longsleepin any case, i need a way to create cryptographically secure random strings, private keys and certificates14:17
jdstrandlongsleep: apps aren't allowed to have net_admin - it is far too powerful (see man capabilities)14:17
longsleepjdstrand: that is helpful thanks - so are you saying openssl does require this?14:18
jdstrandlongsleep: that I am not sure of14:18
jdstrandlongsleep: it could be a harmless denial, but I don't see a denial for openssl itself. did you use snapcraft or deb2snap to build this snap?14:19
longsleepjdstrand: snapcraft14:19
longsleep(with my own plugin)14:20
longsleepi have caps networking and network-service14:20
elopiofgimenez: could you please write the ips to your jenkins and other machines in canonistack, in the trello card.14:20
elopiofirst column.14:20
jdstrandlongsleep: can you try this: adjust /var/lib/apparmor/profiles/<something obvious> to have 'capability block_suspend,' before the trailing '}', then do: sudo apparmor_parser -r /var/lib/apparmor/profiles/<something obvious> then try again?14:21
=== dholbach_ is now known as dholbach
jdstrandfyi, there is an open kernel bug on bad logic for checking something ipv6 related which triggers a net_admin denial (that should be harmless) that tyhicks is working on. so lets see if just block_suspend is enough14:24
longsleepjdstrand: this made no difference, audit now only shows the net_admin deny14:25
longsleepjdstrand: http://paste.ubuntu.com/11973602/14:25
longsleep(there are no denies in syslog when it runs openssl)14:26
jdstrandlongsleep: ok, try to add 'net_admin' in the same way14:26
longsleepjdstrand: ned_admin DENY is gone, openssl still fails14:27
fgimenezelopio: sure14:27
jdstrandlongsleep: ok, then it is something else. I haven't use snapcraft-- is the binary executable?14:28
longsleepjdstrand: why binary? openssl? i am using it from the system14:28
jdstrandlongsleep: ie, the openssl binary?14:28
jdstrandI don't think you are14:28
jdstrandcause there is no apparmor policy to allow that14:29
longsleepi just run "openssl rand -hex 32"14:29
jdstrandI think snapcraft may have shipped a binary in your snap and adjusted your PATH so it seems like you are14:29
longsleepworks fine as root14:29
longsleeperr14:29
jdstrandfind /apps/spreed-webrtc.sideload -name openssl14:30
longsleepsnapcraft doesnt know about openssl14:30
longsleepits not there14:30
longsleepjdstrand: http://paste.ubuntu.com/11973632/14:31
=== chihchun is now known as chihchun_afk
longsleepjdstrand: so you are saying that i cannot run openssl from my snap because there is no apparmor policy to allow it?14:33
longsleepjdstrand: and i should ship openssl in my snap?14:33
jdstrandlongsleep: hmm, so your snap isn't shipping openssl. this is weird. perhaps the denial is getting rate limited14:35
jdstrandlongsleep: the current apparmor policy does not allow openssl, no. that is easy to for us to fix, but before doing that I want to understand what is happening14:35
jdstrandlongsleep: can you add this rule to the apparmor policy in the same manner as above: /usr/bin/openssl ixr,14:36
jdstrandlongsleep: then try again14:36
longsleepsure14:36
longsleepjdstrand: that helped sort of14:37
longsleepJul 31 14:37:32 odroid ubuntu-core-launcher[3434]: unable to write 'random state'14:37
longsleepJul 31 14:37:32 odroid ubuntu-core-launcher[3434]: message repeated 2 times: [ unable to write 'random state']14:37
longsleepjdstrand: and it did create the random strings just fine now (so that only seems to be a warning)14:39
jdstrandlongsleep: ok, one last thing. can you remove the net_admin and block_suspend rules, reload the profile and try again?14:40
jdstrandlongsleep: if that works, we can file a bug14:40
longsleepjdstrand: sure14:40
RlyehHi14:41
RlyehDoes ownlcoud works correctly on ubuntu-core (4)?14:41
longsleepjdstrand: still works with the unable to write 'random state' warning14:41
Rlyeh"https://192.168.1.102/owncloud/" returns Not Found!!!14:41
longsleepjdstrand: full logs: http://paste.ubuntu.com/11973690/14:42
jdstrandlongsleep: oh, this is a go program?14:42
longsleepjdstrand: yes14:43
jdstrandright, so that net_admin comment I made earlier applies to you (ie, harmless denial)14:43
longsleepjdstrand: yes - it seems to work just fine14:43
longsleepjdstrand: and also the block_suspend DENIED does not seem to have any negative effect14:44
RlyehSolved! "https://192.168.1.102:443"14:46
ogra_:)14:48
longsleepjdstrand: the random state file can be specified with export RANDFILE="$SNAP_APP_DATA_PATH/.rnd" - then that error goes away as well14:52
longsleepjdstrand: do you want me to file a bug or will you do it yourself?14:55
longsleepChipaca: could you reproduce the 'sed -i' issue?14:55
jdstrandlongsleep: ok. it seems that kernel rate limiting was in effect and we weren't seeing all the denials. fyi: sudo sysctl -w kernel.printk_ratelimit=014:59
jdstrandlongsleep: if you could file a bug that would be great14:59
longsleepjdstrand: ok - the bug should be to allow /usr/bin/openssl ixr with the default apparmor profile right?15:01
longsleepi am adding key generation, dhparams generation, csr genration and self signing to make sure that works as well with that fix15:02
jdstrandlongsleep: yes15:04
jdstrandcool15:04
longsleepshould i care about the umask for private keys and stuff or does the confinement handle that?15:06
Chipacalongsleep: got half way there, got pulled of to see some FTBFS issue15:07
Chipacarelated to the gcc5 move15:08
longsleepChipaca, jdstrand If you folks are interested in my final start script: http://paste.ubuntu.com/11973970/ (it works fine when profile allows ixr for openssl.15:33
Chipacata15:34
ogra_hmm15:34
ogra_does package.yaml allow globbing for files to be included ?15:34
* ogra_ needs to unclude the overlay/ subdir for rpi overlay dtb's, i dont want to list each dtb individually 15:35
ogra_*include15:35
Chipacalongsleep: may i suggest a "sync" after you created the conf?15:35
longsleepChipaca: good idea thanks15:35
ogra_Chipaca, is sysnc allowed ?15:35
Chipacawe'll find out ;)15:36
ogra_heh, true15:36
Chipaca(how could it not be!)15:36
* longsleep checks15:36
longsleepnope15:37
longsleep49: /apps/spreed-webrtc.sideload/0.0.1/bin/start: sync: Operation not permitted15:37
ogra_yeah, thats what i thought :)15:37
longsleepjdstrand: so - adding the issue now, in the meantime is there any way to add a workaround to my snap?15:40
=== soee_ is now known as soee
longsleepjdstrand: bug 148036615:44
ubottubug 1480366 in Snappy "/usr/bin/openssl should be allowed in default apparmor profile" [Undecided,New] https://launchpad.net/bugs/148036615:44
longsleepChipaca: Maybe you can tell if i can somehow provide my own apparmor profile which allows openssl?16:00
tedmterry, I find it humorous how we basically did independent clean room implementations of get_arch() and they were basically the same :-)16:01
mterryted, ah nice  :)16:01
mterryted, only so many ways to do it  :)16:01
Chipacalongsleep: yes, you can. "webdm" does that, for example.16:01
ChipacaAFAIR :)16:01
Chipacalongsleep: also the docker snap16:01
longsleepChipaca: great thanks16:01
fgimenezhave a nice weekend everyone o/16:11
longsleepChipaca: mhm  snapp.go:498: The "integration" key is deprecated, and all uses of "integration" should be rewritten16:34
longsleepChipaca: thats how webdm does it :D16:35
sergiusenslongsleep: no, webdm does it like this: http://bazaar.launchpad.net/~snappy-dev/webdm/trunk/view/head:/pkg/meta/package.yaml16:36
sergiusenswith security-policy:\napprmor|seccomp entries16:37
longsleepoh i was at http://bazaar.launchpad.net/~snappy-dev/snappy-hub/webdm/view/head:/pkg/meta/package.yaml16:37
longsleepthats probably wrong then16:37
* sergiusens adds note to delete snappy-hub's webdm16:37
longsleepsergiusens: thanks for the hint16:37
sergiusensnp16:38
sergiusensbbs16:38
longsleepwell i just read that custom apparmor profiles trigger manual review, i guess i just add a copy of openssl to my snap16:59
* longsleep found that he cant just copy /usr/bin/openssl :D16:59
jdstrandlongsleep: right, so stepped away for a bit. I'm going to upload this today and it will be in 15.04/edge. it won't hit stable for a few weeks17:28
jdstrandlongsleep: so, since you are using snapcraft, 'just' add openssl to your list of debs and it should add it for you17:29
jdstrandlongsleep: I put 'just' in quotes because I've not used snapcraft and I don't know how easy that is. but other people here do17:29
longsleepjdstrand: yes i did that - it is easy with snapcraft. Even my own plugin supports it17:32
jdstrandok cool17:32
longsleepI have finished a working snap now, but fail to upload Service unavailable. Please try again later. ([])17:32
longsleepstore seems to be borked17:32
jdstrandbeuno: fyi, ^17:32
beunolooking into it17:33
longsleepjdstrand: with my debs plugin i can just add any already built deb file from url or file source into the snap. That way i can easily build armhf snaps on amd64 with snapcraft for clean room built debian packages.17:35
jdstrandneat17:36
longsleepjdstrand: http://paste.ubuntu.com/11974578/ for the snapcraft file17:36
* longsleep likes snapcraft17:36
jdstrandyeah, it is really coming along aiui17:37
jdstrandmterry, ted, rsalveti, et al: ^ :)17:37
beunolongsleep, can you try and upload again, while I chase this?17:38
longsleepnow if i would figure out how to push a merge request to launchpad with git i could send the patches for the debs plugin17:38
longsleepbeuno: trying now17:38
longsleepbeuno: nope - still Service unavailable. Please try again later. ([])17:39
beunothanks longsleep17:39
beunolongsleep, what app is this?  everything else looks healthy17:42
longsleepheh - thats the spreed-webrtc snap i just created17:42
longsleep(with snapcraft)17:42
beunolongsleep, so, a new app instead of an update to an existing one?17:43
longsleepyes new one17:43
beunolongsleep, you seem to have hit a bug17:59
beunosome value in your metadata is too long (over 128 characters)17:59
longsleepbeuno: hah - i have a talent for that17:59
longsleepprobably the description17:59
beunowe'l queue up a fix, but the quickest option would be for you see which one is too long and shorten it  :)17:59
longsleepsure18:00
beunolongsleep, it's the title, I'm being told18:00
longsleeperr18:00
longsleepthat should not be long18:00
beuno"title": "Spreed WebRTC allows people to communicate with audio/video and transfer files over WebRTC. Open Spreed WebRTC with your browser at: https://yoursnappy:8443/ - The SSL certificate, was generated on18:01
beuno                 installation and is self signed.",18:01
longsleepthats whats in the readme.md18:01
longsleepi thought that goes into description18:01
beunoI think the format in readme.md is:18:01
beuno- title18:01
beuno- return character18:01
beuno- description18:01
longsleepAh18:01
longsleepmakes sense18:02
longsleeplet me just provide the title in the web then18:02
longsleepbeuno: Yes that worked. Thanks for your help!18:04
beunolongsleep, np. Sorry for the hiccup18:05
longsleepbeuno: yay it even passed automatic review18:06
beunoit was probably embarrased about the bug18:06
longsleepChipaca: I managed to put spreed-webrtc into the store (armhf only for now) sudo snappy install spreed-webrtc.longsleep if you want to give it a shot - thanks for your help!18:14
Chipacalongsleep: congrats!18:35
longsleepi am traveling the next 4 days - so it would be great if sergiusens would eventually review the updated odrodidc oem snap :P18:39
mterryogra_, rsalveti: who has used the webcam demo successfully? I want to pick their brain19:20
Chipacamterry: define success19:25
Chipacai used it, and it took a pic19:25
Chipacalongsleep: sergiusens is a new dad, so all bets are off wrt his schedule :)19:26
mterryChipaca, I'm using it and it dies with: "GD Error: gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with 0x23 0x7d" when taking a pic19:26
mterryChipaca, I think some weirdness with my webcam I happen to have19:27
mterryChipaca, will play with fswebcam options19:27
Chipacamterry: AFAIK it was built for, and only tested with, logitech cameras19:27
Chipacamterry: so that's quite likely19:27
Chipacamterry: remind me, where was the web demo?19:27
Chipacai'll take another look19:27
mterryChipaca, I'm using a logitech c170...19:27
Chipacawebcam*19:27
Chipacahey, that should work :)19:27
mterryChipaca, webcam-webui is the snap name I believe19:28
Chipacamterry: but the source?19:28
mterryChipaca, oh..  https://developer.ubuntu.com/en/snappy/guides/appliance-builder-guide-webcam/ is how to build one19:28
mterryChipaca, I don't know where the source for our package is19:29
Chipacamterry: no worries19:33
Chipacamterry: so, question, have you looked at the image file?19:33
Chipacamterry: or is that error thrown by fswebcam before actually producing the image?19:33
mterryChipaca, using "-p YUYV" fixed it!19:33
mterryChipaca, per https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=6007619:34
mterryChipaca, fswebcam wasn't making the image at all (or rather, it was spitting out a blank black jpeg19:34
Chipacahah! good one19:34
mterryChipaca, thanks for looking at it anyway  :)19:35
Chipacano worries19:35
Chipacai'll go have another beer, this one in your honour19:35
Chipacaactually some pizza first19:35
mterry:)19:36
Chipacadon't worry, it'll be beer o'clock for you soon19:36
Chipacamterry: --resolution is also good19:47

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