pystemd icon indicating copy to clipboard operation
pystemd copied to clipboard

Enable command?

Open picarro-aegger opened this issue 1 year ago • 1 comments

Hello, I dug through the code and couldn't find an enable command. Is there an ability to enable a service so it comes up on reboot? This is specifically for Instantiated Services. Thank you for this module!

picarro-aegger avatar Jan 23 '24 20:01 picarro-aegger

from pystemd.systemd1 import Manager

with Manager() as manager:
    manager.Manager.EnableUnitFiles(['service_name.service'.encode()], False, True)

Look at the systemd DBus API: https://www.freedesktop.org/wiki/Software/systemd/dbus/

eliskvitka avatar Sep 12 '24 13:09 eliskvitka