Created
March 12, 2019 18:01
-
-
Save vxgmichel/fdaa49066937d56687ad174185fc4411 to your computer and use it in GitHub Desktop.
Demonstrate signal issues in a fusepy application with multiple instances
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
import os | |
import time | |
import pathlib | |
from concurrent.futures import ThreadPoolExecutor | |
from fuse import FUSE, Operations | |
with ThreadPoolExecutor() as executor: | |
mountpoint1 = "./a" | |
pathlib.Path(mountpoint1).mkdir(exist_ok=True) | |
executor.submit(FUSE, Operations(), mountpoint1, foreground=True) | |
mountpoint2 = "./b" | |
pathlib.Path(mountpoint2).mkdir(exist_ok=True) | |
executor.submit(FUSE, Operations(), mountpoint2, foreground=True) | |
try: | |
# Won't stop on a SIGTERM | |
time.sleep(3) | |
finally: | |
# Print the following message to stderr | |
# fuse: fuse_remove_signal_handlers: unknown session | |
os.system("fusermount -u " + mountpoint1) | |
os.system("fusermount -u " + mountpoint2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment