fix(gateway): detect .venv and venv directories for systemd unit generation#2500
Closed
teyrebaz33 wants to merge 1 commit into
Closed
fix(gateway): detect .venv and venv directories for systemd unit generation#2500teyrebaz33 wants to merge 1 commit into
teyrebaz33 wants to merge 1 commit into
Conversation
…ration get_python_path() hardcoded 'venv/' but setup-hermes.sh creates '.venv/'. This caused VIRTUAL_ENV and PATH in the generated systemd unit to point to a nonexistent directory. Add _find_venv_dir() that checks .venv first, then venv, then falls back to sys.prefix (for pip install -e setups). Both get_python_path() and generate_systemd_unit() now use this helper. Fixes NousResearch#2492
This was referenced Mar 24, 2026
Closed
Contributor
|
Closed as duplicate — #2493 by @Mibayy was salvaged and merged via PR #2797 (submitted first, cleanest implementation). Thanks for the contribution @teyrebaz33! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2492
Root cause
get_python_path()andgenerate_systemd_unit()hardcodedvenv/as the virtualenv directory name.setup-hermes.shcreates.venv/by default, so the generated systemd unit hadVIRTUAL_ENVandPATHpointing to a nonexistentvenv/directory.Fix
Add
_find_venv_dir()helper that:.venv/first (setup-hermes.sh default)venv/sys.prefixwhen inside a venv (pip install -e installs)Both
get_python_path()andgenerate_systemd_unit()now use this helper.ExecStartwas already correct (fell back tosys.executable); this fixesVIRTUAL_ENV=andPATH=in the unit file.