Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions archive/v1/src/commands/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Start command implementation for WiFi-DensePose API
"""

import aiofiles
import asyncio
import os
import signal
Expand Down Expand Up @@ -311,10 +312,10 @@ async def _run_as_daemon(config: dict, pid_file: Path) -> None:
sys.stderr.flush()

# Redirect stdin, stdout, stderr to /dev/null
with open('/dev/null', 'r') as f:
async with aiofiles.open('/dev/null', 'r') as f:
os.dup2(f.fileno(), sys.stdin.fileno())

with open('/dev/null', 'w') as f:
async with aiofiles.open('/dev/null', 'w') as f:
os.dup2(f.fileno(), sys.stdout.fileno())
os.dup2(f.fileno(), sys.stderr.fileno())

Expand Down
Loading