alexsilva / supervisor

Supervisor process control system for Windows
http://supervisord.org
Other
122 stars 27 forks source link

[SOLVED]Question: spawnerr: can't find command #33

Closed senayuki closed 3 years ago

senayuki commented 3 years ago

command=cmd 'C:\DevEnv\supervisor\xxx.cmd' but log told me spawnerr: can't find command 'cmd', why? if I write 'C:\Windows\System32\cmd.exe', the situation cannot be changed, it just can't found everything. how to deal with it?

alexsilva commented 3 years ago

Shows how you set up supervisor.conf.

alexsilva commented 3 years ago

https://ss64.com/nt/syntax-run.html

senayuki commented 3 years ago

Shows how you set up supervisor.conf.

Not only cmd, it just simple. php, nginx, etc.,absolute path or command in path env, they all not work. any command cant be executed, so I try to use cmd script.

Thats my supervisor.conf,

[inet_http_server]
port=127.0.0.1:9002
username = admin
password = admin

[supervisorctl]
serverurl = http://127.0.0.1:9002
username = admin
password = admin

[supervisord]
logfile=C:\DevEnv\supervisor\supervisord.log
childlogdir=C:\DevEnv\supervisor\supervisor

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[include]
files = C:\DevEnv\supervisor\conf.d\*.conf
alexsilva commented 3 years ago

But and process configurations can include ?

senayuki commented 3 years ago

just like this, I copy it from a working Linux system.

[program:xxxxx]
process_name=xxxxx
command=cmd 'C:\DevEnv\supervisor\xxx.cmd'
autostart=true
autorestart=true
stdout_logfile=C:\DevEnv\supervisor\log\xxxx.log
alexsilva commented 3 years ago

Read that reference: https://ss64.com/nt/syntax-run.html

Example

[program:ping]
command=cmd.exe /c "E:\supervisor\pingdomain.cmd"
senayuki commented 3 years ago

Read that reference: https://ss64.com/nt/syntax-run.html

Example

[program:ping]
command=cmd.exe /c "E:\supervisor\pingdomain.cmd"

I think it's not about the cmd usage. I execute another command and it shows me not found even an absolute path, so I try to use cmd anything cannot be found, anything was can't find command.

sorry about I am got off work now and my laptop in my office, I have to report you more details tomorrow.

senayuki commented 3 years ago

Read that reference: https://ss64.com/nt/syntax-run.html

Example

[program:ping]
command=cmd.exe /c "E:\supervisor\pingdomain.cmd"

Oh! it's really working! The key is '.exe'... This is a bit strict, sorry I really didn't think of this. Thanks for your help!