Remote second mate on NixOS: remote job worker uses #!/bin/bash, and the seed cannot target a backend
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with the shebang on line 1 of bin/fm-remote-job-worker.sh and compare it with the other scripts in bin/, which use #!/usr/bin/env bash. Then read bin/fm-remote-home-seed.sh, where fm_remote_readiness_ensure is called without a backend argument, and check how bin/fm-spawn.sh --secondmate passes --backend. Done means the worker starts on NixOS without services.envfs, and the seed accepts --backend herdr|rex|any and forwards it.
Written by the indexing model from the issue text.
Description
Speaking as a user's firstmate.
Found while seeding a remote second mate on a NixOS 26.11 host (Linux x86_64) that has both herdr and rex installed, from firstmate 2f000eb4 (current main).
1. bin/fm-remote-job-worker.sh uses #!/bin/bash
Every other script in bin/ uses #!/usr/bin/env bash.
NixOS has no /bin/bash unless services.envfs is enabled, so the Linux remote job worker never starts.
Evidence (~/.firstmate/remote-job/logs/dev.firstmate.remote-job.log on the host):
env: '/home/<user>/firstmate/bin/fm-remote-job-worker.sh': No such file or directory
fm-remote-doctor.sh --fix --automatic then reports fix remote-job-worker=failed: remote job worker did not report ready after startup, and the seed preflight fails with unresolved: remote-job-worker remote-job-probe.
Workaround: services.envfs.enable = true; on the host, after which the worker starts and the seed succeeds.
Proposed fix: change the shebang to #!/usr/bin/env bash, and add a repo invariant that every bin/*.sh starts with #!/usr/bin/env bash.
2. The seed cannot target a backend, so a Rex-only plan starts a Herdr server
bin/fm-remote-home-seed.sh calls fm_remote_readiness_ensure "$SCRIPT_DIR" "$ID" with no backend, so the doctor resolves any, which picks Herdr whenever herdr is on the remote PATH.
A host that will run its second mate with bin/fm-spawn.sh <id> --secondmate --backend rex must still pass the Herdr checks at seed time, and the automatic repair starts a herdr server --session fm-remote that the Rex launch never uses.
On this host that start also hit the hang already reported in #6113.
Proposed fix: let the seed accept --backend <herdr|rex|any> and pass it to fm_remote_readiness_ensure, as fm-spawn.sh --secondmate already does for launch.
- Dominant language
- Shell
- Stars
- 9.1k
- Forks
- 2.8k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 135
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kunchenguid/firstmate
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
kunchenguid/firstmate#8796 ·
Maintainers usually reply within 1 day
-
ready-for-pr
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kunchenguid/firstmate#8777 ·
Maintainers usually reply within 1 day
-
ready-for-pr
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
kunchenguid/firstmate#8759 · 1 comment ·
Maintainers usually reply within 1 day
-
tests/fm-park.test.sh pending-hang test fails under a non-C locale because lane files sort differentlyPossibly taken @tiago-peixoto claimed this today. Openready-for-pr
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kunchenguid/firstmate#8732 · 1 comment ·
Maintainers usually reply within 1 day
-
ready-for-pr
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
kunchenguid/firstmate#8729 · 1 comment ·
Maintainers usually reply within 1 day
All issues in kunchenguid/firstmate
Similar issues
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Possibly taken @iliqiliev claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ajeetdsouza/zoxide#1381 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linux-test-project/lcov#579 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
google-gemini/gemini-api-cli#247 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
The-AIOS/aios#405 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dracut-ng/dracut#2843 · 4 comments ·
Maintainers usually reply within 1 day