之前在ubuntu主机上已经安装了supervisor,今日在配置 jupyter notebook 时相关命令不记得了,特此记录
需要在
/etc/supervisor/conf.d/
的目录下面创建一个叫xxx.conf
的文件。例如:[program:flask_app] ;创建一个名字是app的进程 autorestart=True autostart=True command=python3 hello.py ;python3 hello.py 表示如何执行这个程序 user=zhaozheng directory=/data/app/flask_app/ ;表示执行command的路径
将这个创建的进程文件加入到supervisorctl管理,这样supervisorctl就可以自动启动它们了
sudo supervisorctl update #update sudo supervisorctl start app #启动这个应用