alexsilva / supervisor

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

Unable stop a service #31

Closed pelika closed 3 years ago

pelika commented 3 years ago
  1. Install as a windows service
    python -m supervisor.services install -c abs-path/supervisor.ini  -sn supervisord -sdn "Supervisord Service" 
  2. Start the service
python -m supervisor.services start -c abs-path/supervisor.ini  -sn supervisord

The full system works well.

  1. Stop the service
    python -m supervisor.services stop -c abs-path/supervisor.ini  -sn supervisord

    The service and programs are still running

Need help

alexsilva commented 3 years ago

Is there any information in the logs to help with this problem ?

pelika commented 3 years ago
python -m supervisor.services stop -c abs-path/supervisor.ini  -sn supervisord

Stopping service supervisord

Error stopping service: The service cannot accept control messages at this time. (1061)

There are actually no related log records in log file. But neither net stop supervisord nor python -m supervisor.services stop -c abs-path/supervisor.ini -sn supervisord stop service supervisord.

To end supervisord. I have to run taskkill /im python.exe /f.

alexsilva commented 3 years ago

Can you stop the supervisor using the controller ? python -m supervisor.supervisorctl -c abs-path/supervisor.ini shutdown

pelika commented 3 years ago
Server requires authentication
error: <class 'xmlrpc.client.ProtocolError'>, <ProtocolError for 127.0.0.1/RPC2: 401 Unauthorized>: file: abs-path\env\lib\site-packages\supervisor\xmlrpc.py line: 563
alexsilva commented 3 years ago

At a minimum you have to have these settings in your file (service stops through controller).

[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

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

It can be anything you want.

username = admin
password = admin
pelika commented 3 years ago

Yes, my configure file is like your example.

Try again with username and password

python -m supervisor.supervisorctl -c abs-path/supervisor.ini -u <username> -p <password> shutdown

It does stop the service.

alexsilva commented 3 years ago

These settings must be in the configuration file supervisor.ini. The service will only be able to stop the supervisor with the username and password in the configuration file. The username and password is optional but if configured, it must be as I informed you previously.

http://supervisord.org/configuration.html#inet-http-server-section-settings

pelika commented 3 years ago

Thanks a lot.

Sir, is it possible stop a supervisord service in services.msc window?

alexsilva commented 3 years ago

Yes. Just configure it as I said before.

pelika commented 3 years ago

I figured it out. In my configure file [supervisorctl] is missing. Thanks a lot.

pelika commented 3 years ago

Close this issue?

alexsilva commented 3 years ago

We can close.