I am trying to create an IOT using a Raspberry Pi3 with Ubuntu Core.

I have written my snaps (they do file operations) and I can executed them just fine when I am logged in.

However all processes seem to be killed once I close the ssh session and thus the snaps are no longer executed.

To prove this I packed the following *.sh in a snap and stated it.

while true; do
   echo "runnning: "$(date) > test.status
   sleep 5m

This works as long as i am logged in. If I close the ssh session and open a new one the process is no longer running.

Also checked with ps -a

Does any one know how to keep processes (snaps or shell scripts) active on Ubuntu Core when I log out?


You don't say what the app is actually doing, but it sounds like you really want it to be a service, no? You can do that with a slight tweak to the YAML, for example:

            command: my-binary
            daemon: simple

Now my-app will be a systemd unit, starting on boot.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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