Supervisor以某用户启动program
Supervisor 配置以某用户启动
supervisor使用root启动,但是program 为非root 用户
添加user后不能生效,
1 | [program:jupyter] |
需配置environment
http://supervisord.org/subprocess.html#subprocess-environment
No shell is executed by supervisord when it runs a subprocess, so environment variables such as USER, PATH, HOME, SHELL, LOGNAME, etc. are not changed from their defaults or otherwise reassigned. This is particularly important to note when you are running a program from a supervisord run as root with a user= stanza in the configuration. Unlike cron, supervisord does not attempt to divine and override “fundamental” environment variables like USER, PATH, HOME, and LOGNAME when it performs a setuid to the user defined within the user= program config option. If you need to set environment variables for a particular program that might otherwise be set by a shell invocation for a particular user, you must do it explicitly within the environment= program config option. An example of setting these enviroment variables is as below.
1 | environment=HOME="/home/jupyter",USER="jupyter" |
报错 child process was not spawned
1 | supervisor: couldn't exec /tmp/start_queue.sh: ENOEXEC |