canonical / classic-snap

The `classic` snap
16 stars 9 forks source link

Launch services on startup #15

Open balinabbb opened 6 years ago

balinabbb commented 6 years ago

Hello there!

I am working on a project, where I have a Raspberry Pi 3 with Ubuntu Core, configured as a hotspot with the wifi-ap snap. With the classic-snap, I installed nginx and supervisor to manage my webserver and django backend. I did try to launch them manually, and everything works fine.

However I can not seem to find a way to start them automatically when the raspberry boots. Previously when I went with raspbian, I simply put a supervisord -c supervisor.conf to my /etc/rc.local, and nginx was running automatically.

I used update-rc.d and based on the skeleton in /etc/init.d/skeleton I created a launch script which should run code like:

#!/bin/bash

classic
nginx -s reload
supervisor -c supervisor.conf

After a reboot when I use ps -ef to check my processes I can see that classic is mounted and running, but neither nginx nor supervisor is. I can't seem to run any code after I issue the command classic in a startup script.

Could you please help me with a solution to launch these services when the devices boots?

ogra1 commented 6 years ago

The classic environment is purely for development, it runs a chroot without any init system, so you can not start services in it (on purpose). The purpose here is to give you the ability to use apt/dpkg on the device to make building a snap locally easier. You should look into how to put your ngnix project properly into a snap package instead.

balinabbb commented 6 years ago

Okay, thanks for your time.