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

Allow !restart command to work for Bubbles itself #55

Open
TimJentzsch opened this issue Jan 27, 2023 · 0 comments
Open

Allow !restart command to work for Bubbles itself #55

TimJentzsch opened this issue Jan 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@TimJentzsch
Copy link
Contributor

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,
)

@TimJentzsch TimJentzsch added the enhancement New feature or request label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant