classic-snap
classic-snap copied to clipboard
Launch services on startup
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.
- What I understand is that I can not modify the /etc/rc.local in the readonly snappy system.
- I can also only access nginx and supervisor in the classic dimension.
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?
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.
Okay, thanks for your time.