Created
December 24, 2023 20:42
-
-
Save paigeadelethompson/a6df7613c5e248fd5d67b3277eeef8fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r, w = os.pipe2(os.O_NONBLOCK) | |
with open(Path("/proc/{pid}/fd/{fd}".format(pid=os.getpid(), fd=w)), "wb") as script: | |
script.write("""#!/usr/bin/env bash | |
bash -c "/opt/netcrave/bin/dockerd \ | |
--config-file /etc/netcrave/_netcrave.json \ | |
" \ | |
exit ; true | |
""".encode("utf-8", "strict")) | |
script.flush() | |
await cmd_async("/usr/bin/env", | |
"bash", | |
"/proc/{pid}/fd/{fd}".format(pid=os.getpid(), fd=r)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment