I downloaded the sample webchat files and created a snap package using $ snapcraft snap. How do I run the snap?

webchat files https://github.com/ubuntu-core/snapcraft/tree/master/examples/webchat

$ snap list Name Version Developer ubuntu-core 16.04+20160419.20-55 canonical webchat 0.0.1 $ webchat.run command not found $ snap webchat error: Unknown command 'webchat'

webchat does work when I call it directly as follows $ node /home/chris/software/snapcraft_test/parts/webchat/install/lib/node_modules/webchat-for-a-snap/webchat.js

share|improve this question
up vote 2 down vote accepted

If you take a look at the webchat example's snapcraft.yaml, you'll see this snippet:

apps:
  webchat:
    command: bin/webchat-for-a-snap
    daemon: simple
    plugs: [network-bind]

This tells Snappy that you want this command to be run as a daemon (i.e. a systemd service), which means this should be running as soon as you install it. Try this:

$ ps ax | grep webchat
  2095 ?        Ssl    0:00 node /snap/webchat/100001/bin/webchat-for-a-snap

The example is missing some documentation since it doesn't tell you how to use it, but it's simply running a webserver on port 3000, so try visiting http://localhost:3000 in your web browser.

share|improve this answer
    
how does one 'run' a traditional desktop-style snap application which is not a daemonized service? – bumblehead Apr 30 '16 at 21:30
    
bazaar.launchpad.net/~dpm/ubuntu-calculator-app/snap-all-thi‌​ngs/… I installed ubuntu-calculator-app and it appears in the unity launcher under the label "Calculator" which is not specified in the yaml file. I'm unable to run ubuntu-calculator-app from the shell. Why does unity search only return a match for "Calculator"? How would I run the calculator snap from the shell? – bumblehead Apr 30 '16 at 21:43
    
Judging from the YAML, you'd run it from the terminal with ubuntu-calculator-app.calculator. Unity only understands .desktop files; it displays "Calculator" since that's what's in the .desktop file shipped by that snap. – Kyle May 2 '16 at 12:38
    
The executable commands of a snap are in /snap/bin. If you do not have the path in your PATH variable, go to that folder and run the commands, or add the path. – Alejandro Vera May 3 '16 at 21:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.