Auto start of snap application on boot up

Daniel Manrique daniel.manrique at canonical.com
Thu Sep 8 19:10:58 UTC 2016


On Thu, Sep 8, 2016 at 3:05 PM, Jenny Murphy <jenny.murphy at episensor.com> wrote:
> Hi,
>  I would like my snap application to start automatically when the system
> boots. On a non snappy platform I would add the start line to /etc/rc.local,
> but I see that this is not possible on Ubuntu 15.04 with Snappy.
> So can someone please advise the alternative?
> Thanks.

Hello,

I start a daemon like this:

apps:
    my-nice-daemon:
        command: bin/my-nice-daemon-server
        daemon: simple
        plugs: [network-bind]


my-nice-daemon-server is a simple shell wrapper that sets things up
and starts the daemon.

This will start when the system boots (or when the snap is installed,
so snap install your-snap will get the service running with no extra
work).

Another example is here:

https://github.com/snapcore/snapcraft/blob/master/demos/webcam-webui/snapcraft.yaml

Cheers!

- Daniel
>
> --
> Jenny Murphy
> EpiSensor, Georges Quay House, Georges Quay, Limerick, Ireland
> jenny.murphy at episensor.com  t | +353 (0) 61 512 511  w |
> http://www.episensor.com
>
> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>




More information about the Snapcraft mailing list