Comments (3)
Success!
I've added:
path = [
pkgs.bash
pkgs.wget
pkgs.git
pkgs.docker
pkgs.openssh
pkgs.rsync
];
to the systemd.services.laminar
definition and bash and other utils are now available.
I've learned a lot today.
Thank you @ohwgiles for prompt reply and navigating to the solution :)
from laminar.
So my question is: is laminar calling subshell with some non-login/non-interactive switches that may cause /etc/profile to be skipped?
This is not quite the right angle. /etc/profile
and /etc/bashrc
are parsed by bash
itself, but in your case the child process spawned by laminar has not even executed bash
yet.
The error /usr/bin/env: ‘bash’: No such file or directory
means that env
cannot find bash
, which means PATH
is probably not set correctly, but this will be in the laminard
process itself, not in its subshell.
You can check the environment of a process at /proc/$pid/environ
. You should be able to confirm that the path to bash
is not in laminard
's PATH
.
How are you starting laminard
? Using systemd? I'm not a NixOS user but I suspect there will be some method of adding Environment="PATH=/path/to/nix/bash/dir"
to the [Service]
section of laminar's unit file.
Tagging @maralorn as I believe they set up the Nix package.
from laminar.
@ohwgiles you are right. The $PATH
environment variable is not set correctly and because of that bash
executable can not be found.
Experimenting (and trying to make things work) I've changed shebang for:
#!/run/current-system/sw/bin/bash
which executed Bash correctly, but the commands in script (like wget
, git
, etc) also could not be found because $PATH
was set to (parsed):
/data/laminar/cfg/scripts
/nix/store/j4fwy5gi1rdlrlbk2c0vnbs7fmlm60a7-coreutils-9.1/bin
/nix/store/x6rwgp1jl5sgzwbsaigqkdbdc7krzwj7-findutils-4.9.0/bin
/nix/store/8mzvz6kk57p9aqdk72pq1adsl38bkzi6-gnugrep-3.7/bin
/nix/store/vqj2w8rqghmmp4wkn9lkcym5kzlqk372-gnused-4.9/bin
/nix/store/4mvn48zibv588i7ijbylw3d035kxndr1-systemd-253.6/bin
/nix/store/j4fwy5gi1rdlrlbk2c0vnbs7fmlm60a7-coreutils-9.1/sbin
/nix/store/x6rwgp1jl5sgzwbsaigqkdbdc7krzwj7-findutils-4.9.0/sbin
/nix/store/8mzvz6kk57p9aqdk72pq1adsl38bkzi6-gnugrep-3.7/sbin
/nix/store/vqj2w8rqghmmp4wkn9lkcym5kzlqk372-gnused-4.9/sbin
/nix/store/4mvn48zibv588i7ijbylw3d035kxndr1-systemd-253.6/sbin
instead of:
/run/wrappers/bin
/data/laminar/.nix-profile/bin
/etc/profiles/per-user/laminar/bin
/nix/var/nix/profiles/default/bin
/run/current-system/sw/bin
which I get when I log in to a laminar
user.
The first one looks to me like paths used for building laminar.
How are you starting
laminard
? Using systemd? I'm not a NixOS user but I suspect there will be some method of addingEnvironment="PATH=/path/to/nix/bash/dir"
to the[Service]
section of laminar's unit file.
Yes. I've created myself (as a novice NixOS user, by lots of trials and errors) a systemd service script, that after "nixing" looks like that:
[Unit]
After=network.target
Description=Laminar continuous integration service
[Service]
Environment="LAMINAR_ARCHIVE_URL=https://example.com/archive"
Environment="LAMINAR_BIND_HTTP=unix:/run/laminar/laminar.socket"
Environment="LAMINAR_HOME=/data/laminar"
Environment="LOCALE_ARCHIVE=/nix/store/iv839p4x1k1y7nv1sfgqbbrrk5h99xfg-glibc-locales-2.37-8/lib/locale/locale-archive"
Environment="PATH=/nix/store/j4fwy5gi1rdlrlbk2c0vnbs7fmlm60a7-coreutils-9.1/bin:/nix/store/x6rwgp1jl5sgzwbsaigqkdbdc7krzwj7-findutils-4.9.0/bin:/nix/store/8mzvz6kk57p9aqdk72pq1adsl38bkzi6-gnugrep-3.7/bin:/nix/store/vqj2w8rqghmmp4wkn9lkcym5kzlqk372-gnused-4.9/bin:/nix/store/4mvn48zibv588i7ijbylw3d035kxndr1-systemd-253.6/bin:/nix/store/j4fwy5gi1rdlrlbk2c0vnbs7fmlm60a7-coreutils-9.1/sbin:/nix/store/x6rwgp1jl5sgzwbsaigqkdbdc7krzwj7-findutils-4.9.0/sbin:/nix/store/8mzvz6kk57p9aqdk72pq1adsl38bkzi6-gnugrep-3.7/sbin:/nix/store/vqj2w8rqghmmp4wkn9lkcym5kzlqk372-gnused-4.9/sbin:/nix/store/4mvn48zibv588i7ijbylw3d035kxndr1-systemd-253.6/sbin"
Environment="TZDIR=/nix/store/3yx6fa7gxgp4p6d79skvscvdd21alclp-tzdata-2023c/share/zoneinfo"
ExecStart=/nix/store/zczdbp2jlw0qhsz8jw7zkmckkvrd5nzk-laminar-1.2/bin/laminard -v
RuntimeDirectory=laminar
User=laminar
I have now noticed the $PATH
set in that service! Thank you @ohwgiles ! I will now try to experiment with setting Environment="PATH=...
. I'd like to make it the same as after sourcing /etc/profile
.
from laminar.
Related Issues (20)
- Build jobs outputting loooong lines slowly may delay other server responses? HOT 1
- Do you implement login system to web ui? HOT 1
- Laminar own webhooks HOT 1
- Route from run to job? HOT 1
- SIGSEGV (with a few browser tabs and while fetching a large job log) HOT 12
- Show currently running `run` in graph on jobs page HOT 2
- FE: "Jobs" link not working with new-and-not-yet-built jobs HOT 5
- laminard: `pages` count wrong with no finished run for a given job HOT 3
- Better Average Runtime Calculation to see what to expect for the next builds HOT 1
- Issues with large databases / large job output HOT 28
- Add Content Security Policy (CSP) HOT 3
- Adding PostgreSQL support HOT 8
- Storing list of artifacts in database HOT 5
- Storing the list of artifacts in the database HOT 1
- [feature request] Abort button. HOT 1
- [PATCH] database: fix missing import HOT 1
- [PROPOSAL] Manual triggers HOT 2
- Question on packaging and directory permissions HOT 2
- SigMask has changed, says kj. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laminar.