Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[windows] enable service start/stop commands #1721

Open
dothebart opened this issue Mar 23, 2020 · 2 comments
Open

[windows] enable service start/stop commands #1721

dothebart opened this issue Mar 23, 2020 · 2 comments

Comments

@dothebart
Copy link
Contributor

I'd like to suggest to enable these commended out code paths:
https://github.com/giampaolo/psutil/blob/master/psutil/_pswindows.py#L603

since at least on windows 10 I've seen that it at least doesn't block as rigerous as described in the comment and in #795 .
after invoking stop() I've seen stop_pending in a loop waiting for the service to be stopped, and after start() I've seen start_pending.
I've verified that using ArangoDB which takes a while to start/stop, so these states can be observed:


service = psutil.win_service_get('ArangoDB')

print(service.status())
if service.status() == 'running':
    print("arangod running - first check with arangosh: ")
    service.stop()
while service.status() != "stopped":
    print(service.status())
    time.sleep(1)
service.start()

while service.status() != "running":
    print(service.status())
    time.sleep(1)

(ps: psutils currently seem to be the only python 3 working solution to manipulate services)

@arshianoor5
Copy link

I am working on a project where i need to check multiple services staus all together…
I can add using list but I don’t know if it will work can anyone help me with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants