swevolution supervisord
will give you that start/stop/restart capability, I will try to get that HOWTO posted soon.
In the meantime if you want to run the app in the background, we have daemonize
installed so you can launch your app with that like:
daemonize -a -c /home/you/apps/appname \
-e /home/you/logs/apps/appname/stderr.log \
-o /home/you/logs/apps/appname/stdout.log \
-p /home/you/logs/apps/appname/pid \
/bin/python3.6 /home/you/apps/appname/app.py
Once it's running you can send a kill signal to the process to stop it:
kill $( cat /home/you/logs/apps/appname/pid )
rm /home/you/logs/apps/appname/pid
You can wrap those examples up into your own start
and stop
scripts, and then wrap those scripts up into a restart
like stop; sleep 2; start
.