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

How to enable/disable units? #62

Open
farzadpanahi opened this issue Nov 25, 2021 · 2 comments
Open

How to enable/disable units? #62

farzadpanahi opened this issue Nov 25, 2021 · 2 comments

Comments

@farzadpanahi
Copy link

I cannot find any example on how to enable/disable units. Can someone elaborate on how this can be done using this lib?
I can see there is a function called EnableUnitFiles but I am not sure how it should be used!

@alfonsoIST
Copy link

alfonsoIST commented Feb 21, 2023

Try this:

from pystemd.systemd1 import Manager
with Manager() as manager:
    manager.Manager.EnableUnitFiles([b'/etc/systemd/system/service_name.service'], True, True)

@AndySchroder
Copy link

What are the True values for?

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

No branches or pull requests

3 participants