-
Notifications
You must be signed in to change notification settings - Fork 36
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
How should I start, restart, stop a service? #60
Comments
Having looked at the documentation again and after reading this StackOverflow answer, I think this is the correct way to start, stop and restart services: with Unit(b'your-service.service') as service:
service.Unit.Start('replace') # Start
service.Unit.Stop('replace') # Stop
service.Unit.Restart('replace') # Restart |
Does anyone know how to start the service with sudo? |
That is my question as well. I was hoping to eliminate the systemctl subprocess with pystemd in my user mode application (I need to restart a unit after changing a config file) but I don't see how to do it with this package or any other. |
I got the following error when tried to start a service:
Someone knows what means? |
Hello there,
I was reading the document of this project, and, interestingly, I couldn't find any way to restart or start a service?
Any suggestions? Could you update your documents, please?
This API asks for three parameters; neither name of these parameters nor the type of them is defined or documented anywhere!
Another suggestion, maybe it's better to accept a string from the user and convert it to bytes inside
pystemd
module.Thanks
The text was updated successfully, but these errors were encountered: