Re: systemd reload (ExevReload) support

2017-01-17 Thread Zygmunt Krynicki
Quick grep tells me that this is not currently supported.

On Sat, Jan 14, 2017 at 4:55 PM, Boris Rybalkin  wrote:
> Hi,
>
> Could you tell me if there is systemd  ExecReload support in snap.yaml?
>
> Thank you.
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: DHCP and /etc/resolv.conf

2017-01-17 Thread Zygmunt Krynicki
Quick grep tells me that no interface currently relates to "resolv.conf" file

On Tue, Jan 17, 2017 at 12:01 AM, Joe Coates
 wrote:
> Is there a current slot interface which allows write access to 
> /etc/resolv.conf?
>
> Thanks,
> Joe Coates
>
> 
> From: snapcraft-boun...@lists.snapcraft.io 
>  on behalf of Mark Shuttleworth 
> 
> Sent: Monday, January 16, 2017 4:58:45 PM
> To: Snapcraft
> Subject: Re: DHCP and /etc/resolv.conf
>
> On 16/01/17 16:39, Joe Coates wrote:
>
> I'm snapping an app which includes a DHCP client replacement.   Ultimately it 
> wants to update/replace /etc/resolv.conf. My snap is connected to all the 
> "network" interfaces available in my ubuntu-core, but none seem to allow 
> write access to this file.  Shouldn't an interface like "network-control" 
> allow write access to /etc/resolv.conf ?
>
> I think /etc/resolv.conf is generated from a number of sources, but yes, it 
> should be possible to influence it.
>
> Mark
>
> 
>
> DISCLAIMER:
> This e-mail and any attachments to it may contain confidential and 
> proprietary material and is solely for the use of the intended recipient. Any 
> review, use, disclosure, distribution or copying of this transmittal is 
> prohibited except by or on behalf of the intended recipient. If you have 
> received this transmittal in error, please notify the sender and destroy this 
> e-mail and any attachments and all copies, whether electronic or printed.
>
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Switching to a non-native package

2017-01-16 Thread Zygmunt Krynicki
I'd like to work on enabling Debian in the CI loop and I was thinking
that it would be somewhat easier we switched to non-native packaging
in the upstream tree and similarly switched to quilt in the Debian
tree (we could have separate packaging trees for sid / stretch if that
would help). Since my view may be simplistic I would like to ask the
current most active Debian maintainers of snapd for opinion.

Right now almost all of the CI in the tree is performed on the
packaging that is in the tree as well. The notable exception is 14.04
which has a separate packaging branch. This is unrealistic as the
Debian packaging tree is widely different and even if we built a
package from the in-tree debian directory and tested it on a real
Debian machine the result would not be representative of what a
subsequent upstream release would look like in Debian.

I'd like to propose that we remove the debian directory from the
upstream repository (no special casing) and work on ensuring that
Ubuntu and subsequently Debian are tested equally well whenever we
make a pull request.

Best regards
ZK

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Apparmor error when using classic mode

2017-01-16 Thread Zygmunt Krynicki
Hey

This bug is fixed in the recently released snapd 2.21. Mark's suggestion is
correct. You should not (until 2.21) combine interfaces and classic
confinement. Since you may be interested what happens when you do. In 2.21
you can install a snap that is using classic confinement with --jailmode
which will enable all those plugs/slots and treat it as any other snap.

I hope this helps you out

Best regards
ZK

On Mon, Jan 16, 2017 at 10:02 AM, Mark Shuttleworth  wrote:

> On 15/01/17 08:58, Luke Williams wrote:
>
> Hello,
>
> I have the following error when I try to install my snap in classic mode:
>
> root@ubuntu:~# snap install flexswitch_1.0.0.178.0_amd64.snap --classic
> --force-dangerous
> error: cannot perform the following tasks:
>
> - Setup snap "flexswitch" (unset) security profiles (cannot setup apparmor
> for snap "flexswitch": cannot load apparmor profile "snap.flex
> switch.flexswitch": cannot load apparmor profile: exit status 1
>
> apparmor_parser output:
>
> profile has merged rule with conflicting x modifiers
>
> ERROR processing regexs for profile snap.flexswitch.flexswitch, failed to
> load
> )
>
> - Setup snap "flexswitch" (unset) security profiles (cannot load apparmor
> profile "snap.flexswitch.flexswitch": cannot load apparmor prof
> ile: exit status 1
>
> apparmor_parser output:
>
> profile has merged rule with conflicting x modifiers
>
> ERROR processing regexs for profile snap.flexswitch.flexswitch, failed to
> load
> )
>
>
> I cannot find any information on why it is failing to install. Any thing I
> should look at to see what is keeping this from working or any more
> information you need to assist in troubleshooting?
>
> I am trying to install this snap on 16.04 Server.
>
>
> I have a feeling this is when one tries to combine "confinement: classic"
> with plugs on commands.
>
> Mark
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snappy evolution

2017-01-09 Thread Zygmunt Krynicki

> Wiadomość napisana przez Aleix Pol  w dniu 08.01.2017, o 
> godz. 20:26:
> 
> Hi everyone,
> Last Snappy meeting we discussed several subjects and I would like to
> know what's the status, hence this e-mail.
> - Usage of snappy in random Linux systems: Red Hat et al (Fedora,
> CentOS), random GNU/Linux kernels (e.g. ArchLinux and Android).

I put together a wiki page describing this [1]

[1] https://github.com/snapcore/snapd/wiki/Distributions

> - Some discussed AppStream semantics introduction for integration in
> Software Centers.

I’m not sure about this. Can you expand on what you are asking about?

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snapd free space available check

2017-01-09 Thread Zygmunt Krynicki
I don't think we're doing this yet.


Can you please report an issue so that it can be tracked.

Best regards
ZK

On Sun, Jan 8, 2017 at 6:25 PM, Boris Rybalkin  wrote:

> Hello,
>
> Could you tell me if snapd does any free space check before installing a
> snap?
>
> Github link would be ideal if possible.
>
> Thank you.
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: opengl on ubuntu core 16 on artik 10?

2017-01-05 Thread Zygmunt Krynicki
Hey

I don't have access to that hardware so I don't know personally. If the
kernel and userspace contain the relevant code it should be OK in devmode.
For confinement it is possible that some of those bits will try to access
something that is not permitted by the base set of rules.

Do you have any test code you can try?

Thanks
ZK

On Thu, Jan 5, 2017 at 7:48 PM, Dan Kegel  wrote:

> Hi all,
> has anyone tried artik 10 with ubuntu core 16,
> and what's the story with opengl there?
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Is there any interface to disable the automatic update feature?

2016-12-23 Thread Zygmunt Krynicki

> Wiadomość napisana przez Peng Liu  w dniu 23.12.2016, 
> o godz. 19:10:
> 
> Hi Folks,
> 
> There used to be a command to disable the automatic update feature of 
> ubuntu-core on 15.04 release. Is such interface still available for 16.04?

Not at present. We want to give snaps a way to control the update feature in 
certain specific ways (schedule usual updates and defer updates during critical 
sections). Stay tuned for more development towards that goal next year.

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Content interface `content` attribute

2016-12-23 Thread Zygmunt Krynicki

> Wiadomość napisana przez Kyle Fazzari  w dniu 
> 23.12.2016, o godz. 19:27:
> 
> Hey all.
> 
> I'm trying to figure out what the `content` attribute is for in the
> content interface. The docs say "The content attribute specified of the
> consuming snap (plug) must have a content attribute match in the
> providing snap (slot)." However, I have two snaps, provider side looking
> like this:
> 
>slots:
>  share-foo:
>content: foo
>interface: content
>read: [/]
> 
> Consumer side like this:
> 
>plugs:
>  use-foo:
>content: foo2
>interface: content
>target: /bar
> 
> These interfaces connect fine, and I can see the contents of the

This is a bug. We know about it but fixing was deferred till we can use the 
assertion system to control it.

Currently you can connect things manually but it will not auto-connect.


> provider within $SNAP/bar of the consumer. Running snapd v2.17.1. So
> unless I misunderstand the sentence from the docs, that doesn't seem
> accurate, and I have no idea what this attribute does.
> 
> Any ideas?

Best regards
ZK
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Interface connection and hooks

2016-12-01 Thread Zygmunt Krynicki

> Wiadomość napisana przez Alberto Mardegan  w 
> dniu 01.12.2016, o godz. 12:29:
> 
> Hi all!
>  I've got a few questions about the upcoming interface hooks, to make
> sure that everything is ready in my project (Unity8's Online Accounts)
> to migrate our "click hooks" into the interface hooks.
> 
> So, what follows is my understanding of the situation, and some
> questions; please comment if I got something wrong. :-)

I’ll defer corrections to pstolowski who is implementing this feature, but:

> As I understand it, interface hooks will be run when the interface gets
> connected. Does this mean that for auto-connect interfaces, interface
> hooks will effectively be run at install time?

Yes, they will run when the connection is attempted, even if that is an 
automatic connection.

> I've read that hooks are run with the same confinement as the rest of
> the commands included in the snap; but what about the environment? Will
> the XDG_* variables be properly set?

All the environment will be consistent but see below.

> Will the hook be run as the UNIX user who connected the interface? And
> if the interface is autoconnected, will the hook be run multiple times
> under each different user?

No, they will run as root AFAIK.

> I guess that's enough questions for now :-)
> 

Best regards
ZK
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: install snap on centos

2016-11-30 Thread Zygmunt Krynicki

> Wiadomość napisana przez 蓝森林 <290832...@qq.com> w dniu 10.11.2016, o godz. 
> 12:05:
> 
> Hi,
>  I want to install snap on CentOS 7 , but I can't  find any document 
> shows how to install snap on CentOS 7. Could you please tell me how to 
> install snap on CentOS 7?
> 

Hey

Unfortunately we haven’t ported snapd to CentOS yet. If you are interested in 
helping out the best way to start would be to take the current fedora packaging 
[1] and see what it takes to build it on CentOS 

[1] 
http://pkgs.fedoraproject.org/cgit/rpms/snap-confine.git/tree/snap-confine.spec 
and http://pkgs.fedoraproject.org/cgit/rpms/snap-confine.git/tree/snapd.spec

Best regards
ZK
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Brainstorming KPIs

2016-11-17 Thread Zygmunt Krynicki

> Wiadomość napisana przez Sergio Cazzolato  w 
> dniu 17.11.2016, o godz. 13:17:
> 
> Hello, 
> 
> We were working on a set of KPIs (Key Performance Indicators) mainly focused 
> on the phones, and now we are working defining new ones for all the changes 
> that are coming on. 
> 
> The first step was to work within the KPI and QA teams to define a set KPIs. 
> 
> Now I would like to hear from you which KPIs you think that would be useful 
> to use/reuse for snappy, and which new ones we could include. 
> 
> The KPIs that already exist are:

I think first boot time is interesting (though harder to measure perhaps). 

>   . Reboot time
>   . Web browser metrics 
>  . memory and cpu used scrolling webpages
>  . droameo metrics executing javascript suite
>   . App launch time
>   . Idle cpu time for unity8 
> 
> KPIs already proposed:
>   . Boot time
>   . unity8 QML metrics dragging a window when many windows are opened
>   . Launch time of multiple apps
>   . UI/Graphics latency
>   . Network: bandwidth, latency, packet loss, concurrent users
>   . Snapweb integration

^ What does this measure? 

>   . Other webbrowser metrics
> 
> Thanks
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: snapd-glib 1.3 released

2016-11-14 Thread Zygmunt Krynicki

> Wiadomość napisana przez Robert Ancell  w dniu 
> 14.11.2016, o godz. 04:30:
> 
> Overview of changes in snapd-glib 1.3

Congratulations :-)

Speaking about releases, we have a dedicated list for announcing releases, the 
snapcraft-relea...@snapcraft.io list.
Could you please cross-send your future release announcements?

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Symlink to snapcraft apps no longer working

2016-11-14 Thread Zygmunt Krynicki

> Wiadomość napisana przez Martin Winter  w dniu 
> 11.11.2016, o godz. 10:54:
> 
> Not sure when this (recently) changed.
> 
> All apps as defined by a snap are prefixed with the snap name
> 
> Ie, I have under apps a “vtysh” defined, which then ends up as
> quagga.vtysh (for the quagga snap).
> 
> So far no issue.
> 
> Now, a few weeks/months back, I was able to create a symlink
> with “vtysh” pointing to “quagga.vtysh” and then could use the same
> simple “vtysh” command to call the app. (same as traditional package installs)


I think this is related to snap-run. You may have noticed that the quagga.vtysh 
itself is a symlink to /usr/bin/snap. The new „snap run” command understands 
symlinks and uses this as a hint on what to run.


> 
> Link had to be done outside snap, but it allowed to keep all scripts
> unchanged.
> 
> At the current snapd version (2.16ubuntu3), this does no longer work.
> 
> all apps ends up as a symlink to the same /usr/bin/snap binary and somehow the
> binary seems to fail to call the correct app if there is another symlink
> used.
> 
> Is there a way to get symlinks to still work as before?
> 
> - Martin
> 
> 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Provisional snap for DUB (D language package/build manager)

2016-11-14 Thread Zygmunt Krynicki

> Wiadomość napisana przez Joseph Rushton Wakeling 
>  w dniu 01.11.2016, o godz. 22:31:
> 
> On 27/10/16 22:13, Joseph Rushton Wakeling wrote:
>> On 27/10/16 08:37, Didier Roche wrote:
>>> I would look at /var/log/syslogs. Apparmor and seccomp denials are
>>> listed there. Note that if you didn't already, you should really start
>>> developping your snap in devmode. That way, it will get confinment out
>>> of the equasion to get your relocatable code and dependencies working.
>>> Then, we can turn on confinement and figure out those issues to be able
>>> to publish in the stable channel.
>> 
>> Yea, I probably should have started with devmode.  Thanks for the advice 
>> about
>> syslogs; I'll check it out and see what I can find.
> 
> OK, so it looks like apparmor was indeed responsible.  The loglines in 
> question:
> 
> Oct 30 17:50:50 computername kernel: [ 9532.992875] audit: type=1400 
> audit(1477846250.853:43): apparmor="DENIED" operation="link" 
> profile="snap.dub.dub" 
> name="/home/username/code/D/dgraph/build/dgraph_graphtest" pid=22464 
> comm="dub" requested_mask="l" denied_mask="l" fsuid=1000 ouid=1000 
> target="/home/username/code/D/dgraph/.dub/build/application-debug-linux.posix-x86_64-ldc_0-B7AFC7F4AA486AA98C5445F91F5653DB/dgraph_graphtest”

This is a link (or symlink, not sure) operation.

> Oct 30 17:50:50 computername kernel: [ 9533.035303] audit: type=1326 
> audit(1477846250.897:44): auid=4294967295 uid=1000 gid=1000 ses=4294967295 
> pid=22464 comm="dub" exe="/snap/dub/x1/bin/dub" sig=31 arch=c03e 
> syscall=92 compat=0 ip=0x7f9b72d13717 code=0x0

This seems to be chown(1)

> 
> I'm not experienced with apparmor, so could someone explain exactly what this 
> means?  (I get the general idea, but the specifics would be useful to 
> understand precisely.)
> 
> In particular, is there an obvious reason why this might be showing up with 
> the dub snap, when the earlier ldc2 snap didn't have this problem?  I would 
> guess because the ldc2 instance used by the snap-packaged dub is internal to 
> the snap and does not benefit from the home-directory interface that dub 
> itself gets?
> 
> Setting the containment to devmode removes the problem, but it would be nice 
> to be able to have strict confinement earlier rather than later.
> 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snap hangs when accessing a special /dev/file (/dev/vcio) [ubuntu-core 16 / RaspberryPi2]

2016-11-07 Thread Zygmunt Krynicki

> On 6 Nov 2016, at 11:50, Jacques Supcik  wrote:
> 
> Dear community.
> 
> I have a program, written in go, and running on a raspberry Pi 2, which 
> displays messages on a LED panel. The panel is made of "neo pixels" and is 
> connected to the GPIO of the raspberry Pi. Internally, it uses the DMA and 
> PWM to generate and accurate signals.
> 
> The program currently runs well on a Raspbian system and I would like to move 
> to ubuntu-core. I was able to build the snap and to deploy it on a raspberry 
> Pi 2 running Core version 16. I installed the snap with "--dangerous", but as 
> soon as the system configure the DMA/PWM/GPIO, it just freezes.
> 
> I installed snappy-debug to check the logs and this is what I get:
> 
> = AppArmor =
> Time: Nov  6 09:28:45
> Log: apparmor="DENIED" operation="open" profile="snap.telecom-tower.daemon" 
> name="/dev/vcio" pid=4441 comm="tower" requested_mask="r" denied_mask="r" 
> fsuid=0 ouid=0
> File: /dev/vcio (read)
> 
> = Seccomp =
> Time: Nov  6 09:28:45
> Log: auid=4294967295 uid=0 gid=0 ses=4294967295 pid=4441 comm="tower" 
> exe="/snap/telecom-tower/x1/bin/tower" sig=31 arch=4028 14(mknod) 
> compat=0 ip=0x76e3aaf6 code=0x0
> Syscall: mknod
> 
> Note that if I scp the binary file and run on ubuntu core as root, then the 
> program runs fine. (I don't install the snap, I just run the binary from the 
> home directory.) 
> 
> Does someone have an idea about what I can do to make my snap run?

You need an interface for accessing this specific hardware. In absence of one 
right now just get started with devmode. In your snapcraft.yam use 
“confinement: devmode”. I think there’s an ongoing work to support this 
interface but to be sure please report a bug on bugs.launchpad.net/snappy and 
tag it with the “snapd-interface” tag please.

Interfaces are added pretty quickly so you can even track daily development 
using the edge channel of the core snap.

Best regards
ZK
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Installing snap on Fedora

2016-10-17 Thread Zygmunt Krynicki

> Wiadomość napisana przez jb  w dniu 17.10.2016, o godz. 
> 13:39:
> 
> Hi all,
> 
> 
> I have prepared and published Kdenlive snap packages (currently in devmode 
> because of the dbus access issue). I requested some feedback, and a user 
> reported the following issues when trying to install on Fedora:
> kdenlive-devel on a fresh Fedora 24 install using the snapd installation 
> method and install command you gave, I get this error: "error: unknown flag 
> `force-dangerous'
> ". Removing that flag from the install command produces this error:
> 
> sudo snap install --edge --devmode kdenlive-devel
> error: cannot communicate with server: Post 
> http://localhost/v2/snaps/kdenlive-devel: dial unix /run/snapd-snap.socket: 
> connect: no such file or directory...
> 
> Are these known issues on Fedora ? Any workaround?
> 

Hey

Can you please use journalctl to see what has happened to snapd?

Thanks
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Access to other commands

2016-09-15 Thread Zygmunt Krynicki

> On 15 Sep 2016, at 01:43, Leo Arias  wrote:
> 
> On 2016-09-07 19:31, Mark Shuttleworth wrote:
>>> 1) Is there some way I can be specifying a list of commands my snapped
 app is allowed to call?
>> You could. But I think there is a class of things that should be allowed
>> to integrate with the classic shell environment, which means they can
>> shell out to lots of things.
> 
> What about --devmode? Should devmode allow calls to all binaries in the
> $PATH?

As discussed a few times this is technically challenging to do.

All of “classic” is visible from /var/lib/snapd/hostfs/ but there is no 
guarantee that you can run them in any way. They may require the classic 
dynamic linker, the classic runtime libraries and the classic filesystem layout 
that are all lost when snap-confine sets up the execution environment. If 
there’s desire to run executables from the outside we could look for solutions 
but this is not as simple as “just use devmode”

Thanks
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Access to other commands

2016-09-08 Thread Zygmunt Krynicki

> On 8 Sep 2016, at 09:17, Eloy García (PC Actual)  
> wrote:
> 
> Hi all.
> 
> I currently have several problems with my snap package for 
> wallpaperdownloader application, a java-based piece of software that 
> downloads wallpapers from the Internet, and maybe this is the solution for 
> some of them.
> In this application, I execute some Linux command tools such as xdg-open and 
> gsettings. They work flawlessly within a "native" environment, but when I try 
> to execute them inside the snap package, they simply don't work.
> 
> Gustavo, when you suggest to use the line: bus-send --print-reply --session 
> --dest=com.canonical.SafeLauncher / com.canonical.SafeLauncher.OpenURL 
> string:"$1"
> could you give an example of that? I mean, if I want to, for example, open a 
> browser using "xdg-open https://www.google.com"; executing this command from 
> my Java code, what would be the line I should use instead?. This implies to 
> modify my java code too and I had to do the distinction between the 
> application executed in a native environment and in a snap confinement. This 
> wouldn't be the desired way of packaging the app. Would be possible to use 
> some kind of interface to have access to the "native" command line tools 
> installed in the system? This way, source code would be agnostic (I mean, I 
> didn't have to tweak the application depending on the environment executed) 
> and it would be only a matter of snapcraft.yaml configuration.
> 

I believe there’s a special version of xdg-open that does exactly what that 
bus-send line above is doing.

https://github.com/snapcore/snapd-xdg-open/blob/master/src/xdg-open.c

You can add a part to your snap that includes this executable so that all the 
other code in your snap can remain the same.

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Access denied to /dev/ttyUSB0

2016-09-07 Thread Zygmunt Krynicki

> On 7 Sep 2016, at 16:05, Loïc Minier  wrote:
> 
> Hi,
> 
> You need to use:
> plugs: [serial-port]
> 

I don’t think this will work as this is a 15.04 based system.

Jenny, can you confirm that you are using Ubuntu Core 15.04?

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: /snap/bin not in $PATH on desktop

2016-09-07 Thread Zygmunt Krynicki

> On 7 Sep 2016, at 13:16, Sylvain Pineau  wrote:
> 
> Hello,
> 
> I noticed that I was not able to call other snap commands from my own snap on 
> my desktop.
> So I tested what was defined using the hello-world.env command.
> 
> On desktop (with ubuntu-core 16.04.1 rev 352)
> 
> $ hello-world.env | grep ^PATH=
> PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> 
> But on a true snappy system (with ubuntu-core 16.04.1 rev 453), I get:
> 
> $ hello-world.env | grep ^PATH=
> PATH=/home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
> 
> Is there any reason to not have /snap/bin as part of the $PATH available to 
> snap commands?

Snaps cannot execute other snaps. The PATH difference is caused by how 
snap-confine behaves when it runs on classic but in general even if you used an 
absolute path you would not be able to start any other applications from 
/snap/bin. Allowing this would create an implicit interface (dependency between 
your snap and some other, perhaps third party, snap).

If you need access to executables that you control you can use the content 
interface to bind mount another snap into your own snap and execute those 
commands directly, with the same security profile as the running application.

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Nvidia related bug with snap

2016-09-03 Thread Zygmunt Krynicki

> Wiadomość napisana przez Érico P  w dniu 
> 03.09.2016, o godz. 22:32:
> 
> Hello,
> 
> I had crash trying to run the Krita snap
> 
> https://bugs.kde.org/show_bug.cgi?id=368198
> 
> I do have a Nvidia GPU, but using prime, I had selected the Intel GPU.
> 
> Are graphical snaps expected to work with Ubuntu if the Nvidia GPU is 
> disabled?
> 
> I don't know if here, IRC, AskUbuntu or Launchpad is the proper place to ask 
> this question.
> 

Hey.

Can you share some more details please?

- Which distribution are you using
- Which version of the driver are you using (if you don’t know, which GPU 
exactly do you have)
- How did the crash look like
- Which revision of ubuntu-core and krita did you have (hint: snap list)

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snapping LDC (LLVM-based D compiler)

2016-08-29 Thread Zygmunt Krynicki

> Wiadomość napisana przez Joseph Rushton Wakeling 
>  w dniu 27.08.2016, o godz. 22:45:
> 
> Hello all,
> 
> I thought I'd have a go at making a snap of LDC, the LLVM-based compiler for 
> the D programming language.  I recognize that snapping a compiler might be 
> jumping ahead of the current intended use-case(s), but it's fun to see what 
> could be possible -- and besides, D's compilers are updated fairly often, so 
> it would be great to be able to package them easily in a truly cross-distro 
> form.
> 
> It's been very exciting to see how straightforward most things are to get set 
> up, but I ran into a few issues that are blockers to finalizing the snap, so 
> I thought I'd ask here for advice on how to address them.
> 
> First things first: LDC is built using cmake, and getting the essentials of 
> the `snapcraft.yaml` file set up was super-simple:
> 
> -
> name: ldc
> version: "1.0.0"
> summary: D compiler with LLVM backend
> description: LDC is a compiler for the D programming Language.
> It is based on the latest DMD frontend and uses LLVM as backend.
> confinement: devmode
> 
> apps:
>  ldc2:
>command: ldc2
>plugs: [home]
>  ldmd2:
>command: ldmd2
>plugs: [home]
> 
> parts:
>  ldc:
>plugin: cmake
>source: git://github.com/ldc-developers/ldc.git
>source-tag: v1.0.0
>build-packages:
>- ldc
>- llvm-dev
>- libconfig++-dev
>- libcurl4-gnutls-dev
>- libedit-dev
>- zlib1g-dev
> -
> 
> This happily builds and generates a snap, and so far as I can tell from the 
> install, all the usual required files are there.  (By the way, I really do 
> mean to have ldc in the `build-packages`; LDC now requires a D compiler to 
> build it, so it's necessary to have the older ubuntu-packaged ldc 0.17.1 to 
> build with.)
> 
> The problems with the snap are threefold:
> 
>  * LDC creates two different executables, ldc2 and ldmd2 (the latter is a
>wrapper that implements compiler flags to match D's reference compiler,
>"Digital Mars D" or dmd).  However, the names given to the snap executables
>are ldc.ldc2 and ldc.ldmd2.  While I understand the wish to namespace, is
>there any way to drop the `ldc.` prefix ... ?
> 
>  * LDC creates a config file, `/etc/ldc2.conf`, using libconfig.  This defines
>some default compiler flags, including the default 'include' location of
>header files for the runtime and standard library.  However, perhaps 
> because
>of how the snap is built, the include paths are specified as if the snap's
>install dir was the root:
> 
>switches = [
>"-I/include/d/ldc",
>"-I/include/d",
>"-L-L/lib",
>"-defaultlib=phobos2-ldc,druntime-ldc",
>"-debuglib=phobos2-ldc-debug,druntime-ldc-debug"
>];
> 
>This means that when one tries to compile anything, the compiler emits
>error messages that it is unable to locate the headers for runtime or
>standard-library modules.  If one manually specifies the full-path
>include locations:
> 
>-I/snap/ldc/current/include/d/ldc -I/snap/ldc/current/include/d
> 
>... then the compiler can build an object file, but runs into the third
>of the problems ...
> 
>  * LDC uses the default C compiler for linking, but the snap-installed
>compiler fails to find it, exiting with a message:
> 
>Error: failed to locate gcc


You can try to „see” gcc via /var/lib/snapd/hostfs/usr/bin/gcc but I bet it 
won’t „just work” because we are now in a chroot [1]. You could try to put gcc 
inside your own snap (I would actually do this to stay fully self-contained) 
but that might require different work to snap.

Given enough permissions you could get out of the chroot and run host’s gcc 
with appropriate arguments but you might run into issues with passing files 
around by path (see the referenced link for details). If you only use -pipe 
then things should work.

We also have snapd-xdg-open and I was wondering if it would be okay to extend 
it to do things like „run this command on the host with the permission of the 
current user” if the command can be white-listed to belong to an interface 
(e.g. you we could say that LDC has permissions to run „gcc” with any 
arguments).

[1] http://www.zygoon.pl/2016/08/snap-execution-environment.html 


> 
> Can anyone advise on how best to address any of these problems?  I would 
> assume the last in particular is down to the lack of an interface for access 
> to things like a linker or other aspects of a build system?
> 
> I'm really delighted with how blissfully simple it was to get the essentials 
> of packaging in place, and it would be really great if there were 
> straightforward solutions to the remaining issues.
> 
> Thanks in advance for any advice, and best wishes,
> 
>-- Joe
> 
> --

Re: File permissions within a snap

2016-08-25 Thread Zygmunt Krynicki

> Wiadomość napisana przez Jenny Murphy  w dniu 
> 25.08.2016, o godz. 15:56:
> 
> Hi,
>  Yes thank you that is what I was looking for.
> 
> 
> On 25 August 2016 at 14:12, Sergio Schvezov  > wrote:
> El jueves, 25 de agosto de 2016 08h'31:34 ART, Jenny Murphy 
> mailto:jenny.mur...@episensor.com>> escribió:
> Hi,
>  Unfortunately, either inside or outside quotes it is still blank.
> 
> Do you have a link to that hello world example you mentioned.
> 
> The previous reply (from yesterday) mentioned the use of interfaces, maybe
> this would be cleaner than messing around with scripts and environment
> variables?
> I am using snapcraft 1.1.0, are interfaces available to use in that version?
> 
> It should be SNAP_APP_PATH and SNAP_APP_DATA_PATH
> 

I’m sorry, my advice was designed for snapd in 16.04 and beyond. I was not 
aware you are looking at 15.04 support.

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: File permissions within a snap

2016-08-24 Thread Zygmunt Krynicki

> Wiadomość napisana przez Jenny Murphy  w dniu 
> 24.08.2016, o godz. 12:58:
> 
> Hi,
>  I have a java application built as a .snap.
> As part of its normal operation it will create some files (for output).
> However this is not successful due to permissions issue :
> For example , I tried to create the file in /home/ubuntu/examples/ :
> java.io.FileNotFoundException: /home/ubuntu/examples/example.txt (Permission 
> denied)
> I got a similar result whenI tired to create it in the current dir :
> /apps/gateway.sideload/IcNYWMFDGBeY

You can freely create files in $SNAP_USER_DATA - the per-user data directory or 
$SNAP_DATA - the global data directory (for daemons).

If you want to write to other locations you need an interface to do it. For 
example you can use the home interface to get write access to most of the $HOME 
directory.

You can do this by just defining a „home” plug on your application.

Best regards
ZK
> 
> So is there a way around this?
> 
> Thanks in advance for any suggestions.
> 
> -- 
> Jenny Murphy
> EpiSensor, Georges Quay House, Georges Quay, Limerick, Ireland
> jenny.mur...@episensor.com   t | +353 (0) 
> 61 512 511  w | http://www.episensor.com -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: A snap that uses other apps

2016-08-23 Thread Zygmunt Krynicki

> Wiadomość napisana przez Alejandro Vera  w dniu 
> 23.08.2016, o godz. 15:37:
> 
> Hi everyone... 
> 
> I am developing an app for internal use in my company.
> 
> In my app I can config an external commando line app to format code and I can 
> config my browser to open files. But when I package it as a snap my app can 
> not see those apps
> 
> What should I do? I think this is very common. I hope I do not have to 
> package the browser and the cli-app in my snap
> 

It depends on how those apps look like.

In general the whole host filesystem is exposed as /var/lib/snapd/hostfs. In 
devmode you can run anything installed there (that is the root filesystem of 
your computer) assuming you set PATH, LD_LIBRARY_PATH and anything else like 
that to point there.

Best regards.
ZK


> Thanks!
> 
> -- 
> Alejandro Vera
> http://www.recicleta.cl 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Snappy + root encryption

2016-08-23 Thread Zygmunt Krynicki

> Wiadomość napisana przez Mark Shuttleworth  w dniu 
> 23.08.2016, o godz. 13:21:
> 
> Hi Xavier
> 
> With snaps on classic (deb-based) Linux there have been some bugs
> related to encrypted home directories, not sure if those are fixed yet
> but they are definitely in progress.

All known bugs related to encryption are fixed upstream and are a part of the 
1.0.40 release. I am working on the SRU process to get those fixes released 
across the distribution landscape.

> On Ubuntu Core (where the whole system is a collection of snaps, there
> are no debs by default) it should be possible to have an encrypted disk.
> The main question would be what your expectations of the boot process
> would be. Most people who want Ubuntu Core are doing so for distributed
> devices where there isn't going to be a human around if the machine reboots.
> 
> Mark
> 
> On 23/08/16 06:26, Xavier Pegenaute M2M wrote:
>> Hi all,
>> 
>> I am interested on building a snappy system with encryption to rootfs,
>> I've been looking around but I didn't find any document or guide about
>> it. Does snappy support it? If this is the case some one could point
>> me to some info about it?
>> 
>> Regards
>> 
> 
> 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: [JavaGame] A snap question for audio.

2016-08-11 Thread Zygmunt Krynicki

> El 11 ago 2016, a las 7:37, Howy Wang  escribió:
> 
> Hi there,
> 
> I made a snap, javagame and it works well.
> Now the snap upload for javagame.howy to the Ubuntu Store has been approved.
> But I found something wrong with audio, the following is the wrong message 
> during running the snap.

Do you see any denials in the system log? You can check for them using 
journalctl -f when you start the game.

> 
> [MUSIC][11:39:29] Playing song: Towards The End
> [ERROR][11:39:29] Problem playing file 
> sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@61ab49d
> [ERROR][11:39:29]javazoom.jl.decoder.JavaLayerException: Cannot create 
> AudioDevice
> [MUSIC][11:39:29] Playing song: yoshi song
> [ERROR][11:39:29] Problem playing file 
> sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@35104da8
> [ERROR][11:39:29]javazoom.jl.decoder.JavaLayerException: Cannot create 
> AudioDevice
> 
> I have checked my snapcraft.yaml has "plugs" with pulseaudio and "$ snap 
> interfaces" has ":pulseaudio javagame:, too.
> This is the $ snap interfaces 
> 
> howy@howy-Vostro-14-5480:~/examples/java$ snap interfaces 
> Slot Plug
> :camera  -
> :cups-control-
> :firewall-control-
> :gsettings   -
> :hardware-observe-
> :home
> atom-cwayne,javagame,jtiledownloader,openjdk-demo,qtclocks,wallpaperdownloader
> :locale-control  -
> :log-observe snappy-debug
> :modem-manager   -
> :mount-observe   -
> :network jtiledownloader,openjdk-demo
> :network-bindjavagame,jtiledownloader,wallpaperdownloader
> :network-control -
> :network-manager -
> :network-observe -
> :opengl  game-2048
> :optical-drive   -
> :ppp -
> :pulseaudio  javagame
> :snapd-control   -
> :system-observe  -
> :timeserver-control  -
> :timezone-control-
> :unity7  game-2048,openjdk-demo,qtclocks
> :x11 
> game-2048,javagame,jtiledownloader,qtclocks,wallpaperdownloader
> 
> Any suggestions or examples can help to solve audio issue? 
> Thank you.
> 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Connecting snap interfaces

2016-08-08 Thread Zygmunt Krynicki

> El 8 ago 2016, a las 16:09, Christopher Arges  
> escribió:
> 
> I'm snapping up a daemon and client program that requires several
> non-auto-connect interfaces.
> 
> Right now for a user to install and run the program(s) correctly requires:
> 
> snap install daemon-program_1_amd64.snap
> snap connect daemon-programd:hardware-observe ubuntu-core:hardware-observe
> snap connect daemon-programd:system-observe ubuntu-core:system-observe
> snap connect daemon-program:hardware-observe ubuntu-core:hardware-observe
> snap connect daemon-program:system-observe ubuntu-core:system-observe
> sudo systemctl restart snap.daemon-program.daemon-programd
> 
> How can I make my snap auto-connect these special interfaces?

This will be available to device makers through the gadget snap and device 
model assertions AFAIK. I suspect we may also allow this later on when more 
assertions are in place.

For now I don’t know of any other way but you can track the development of 
ubuntu-image and the gadget snap (I don’t have any links handy but I bet the 
folks hacking on this will reply with more details).

Best regards
ZK


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Using sudo from within a snap

2016-08-08 Thread Zygmunt Krynicki

> El 6 ago 2016, a las 20:53, Fabio Colella  escribió:
> 
> I think using sudo should require proper plug an permission, because I assume 
> your action to be something out of the ordinary app bounds

This is not really true. Any snap can have a background application that runs a 
root. Sudo feels more complicated to support but definitely doesn’t give you 
any more power.

> 
> On 6 August 2016 at 15:54, Chris Wayne  > wrote:
> Hi guys,
> 
> I seem to be having some issues while running anything as sudo from within a 
> snap (namely bug https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1610292 
> ).  Is this 
> something that's expected to work, or is this out of scope (it does work if 
> you run the snap itself with sudo, although then it's a bit annoying as 
> you're hit with https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1595558 
> ).
> 
> Thanks
> Chris
> 
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io 
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft 
> 
> 
> 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/snapcraft

-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft