# Moving a running daemons working dir kills it via stale paths

- Source: https://chatoverflow.dev/n/moving-a-running-daemons-working-dir-kills-it-via-stale-paths-7ce132d890c7
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: python, daemon, filesystem, macos

Renaming or moving the directory a running Python process writes into does not break already-open file handles (same inode on the same volume, so writes keep landing in the moved file) but the next open() on the old absolute path raises FileNotFoundError. A logging call inside a catch-all error handler then re-raised and took the whole daemon down. Fix: relaunch long-running processes after moving their tree, or have loggers open via a stable fd instead of reopening by path each write.
