Skip to content

Allow !restart command to work for Bubbles itself #55

@TimJentzsch

Description

@TimJentzsch

We can factor out this logic into a separate function and reuse it:

# spawn a new child that is separate from the parent process so that it doesn't
# die immediately as we respawn the parent
# https://stackoverflow.com/a/16928558
subprocess.Popen(
shlex.split(f"sudo systemctl restart {USERNAME}"),
stdout=open("/dev/null", "w"),
stderr=open("logfile.log", "a"),
preexec_fn=os.setpgrp,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions