diff --git a/.idx/dev.nix b/.idx/dev.nix index 8f01c7c6..1a7a173d 100644 --- a/.idx/dev.nix +++ b/.idx/dev.nix @@ -102,6 +102,7 @@ # Example: start a background task to watch and re-build backend code # watch-backend = "npm run watch-backend"; start-mongodb = "/usr/bin/mongod -f ~/json-scada/platform-nix-idx/mongod.conf"; + start-supervisor = "(supervisord -c ~/json-scada/platform-nix-idx/supervisord.conf &)"; }; }; }; diff --git a/platform-nix-idx/supervisord.conf b/platform-nix-idx/supervisord.conf new file mode 100644 index 00000000..c45165d3 --- /dev/null +++ b/platform-nix-idx/supervisord.conf @@ -0,0 +1,53 @@ +; Sample supervisor config file. +; +; For more information on the config file, please see: +; http://supervisord.org/configuration.html +; + +[inet_http_server] ; inet (TCP) server disabled by default +port=127.0.0.1:9000 ; ip_address:port specifier, *:port for all iface +username= ; default is no username (open server) +password= ; default is no password (open server) + +[supervisord] +logfile=/tmp/supervisord.log ; main log file; default $CWD/supervisord.log +logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB +logfile_backups=10 ; # of main logfile backups; 0 means none, default 10 +loglevel=info ; log level; default info; others: debug,warn,trace +pidfile=/tmp/supervisord.pid ; supervisord pidfile; default supervisord.pid +nodaemon=false ; start in foreground if true; default false +silent=false ; no logs to stdout if true; default false +minfds=1024 ; min. avail startup file descriptors; default 1024 +minprocs=200 ; min. avail process descriptors;default 200 + +; The rpcinterface:supervisor section must remain in the config file for +; RPC (supervisorctl/web interface) to work. Additional interfaces may be +; added by defining them in separate [rpcinterface:x] sections. + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +; The supervisorctl section configures how supervisorctl will connect to +; supervisord. configure it match the settings in either the unix_http_server +; or inet_http_server section. + +[supervisorctl] +serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket +;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket +;username=user ; should be same as in [*_http_server] if set +;password=123 ; should be same as in [*_http_server] if set +;prompt=mysupervisor ; cmd line prompt (default "supervisor") +;history_file=~/.sc_history ; use readline history if available + +[program:cs_data_processor] +; args: instance# loglevel +command=/usr/bin/node /home/user/json-scada/src/cs_data_processor/cs_data_processor.js 1 1 +autostart=true +numprocs=1 ; number of processes copies to start (def 1) +directory=/home/user/json-scada/src/cs_data_processor/ ; directory to cwd to before exec (def no cwd) +user=jsonscada ; setuid to this UNIX account to run the program +redirect_stderr=true ; redirect proc stderr to stdout (default false) +stdout_logfile=/home/user/json-scada/log/cs_data_processor.log ; stdout log path, NONE for none; default AUTO +stdout_logfile_maxbytes=10MB ; max # logfile bytes b4 rotation (default 50MB) +stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) +stdout_capture_maxbytes=10MB ; number of bytes in 'capturemode' (default 0) \ No newline at end of file