[Python] Starting a systemd service via python

Discussão em 'Python' iniciado por Stack, Julho 6, 2025.

  1. Stack

    Stack Membro Participativo

    Is there a way to start/restart a systemd service via python?

    I know that I can make a system call - but then I also could write this in shell script...

    from subprocess import call

    call(["systemctl", "restart service"])


    I heard that systemd has some python binds, but as far as I saw they only cover the journal.

    Continue reading...

Compartilhe esta Página