2

Here is my fork of Keter with *.nix files generated via cabal2nix: https://github.com/bsima/keter/tree/nix

I did nix-build shell.nix on my dev machine (NixOS 17.09), then used nix-copy-closure to put it on my VPS on Digital Ocean (also NixOS 17.09, via nix-infect).

I created a systemd service which starts just fine, but then Keter dies after trying to fork a process for the server:

2018-02-03 19:34:03.21: Data.Conduit.Process.Unix.monitorProcess: /opt/keter/temp/pprjam-0/dist/bin/pprjam: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

It can't find exec, which I believe should be a part of coreutils. I doubt coreutils is missing, but just in case I put it in my environment.systemPackages and rebuilt, but it still didn't work.

So that makes me think this is a $PATH problem, or this issue (which I don't quite understand, so I'm assuming it's more likely a $PATH problem).

Is there something I have to do in Keter's default.nix in order to help it find exec on the $PATH of the target machine? What else am I missing here?

Ben
  • 574
  • 3
  • 12
  • Note that I added a keter module to nixpkgs, it's available in all unstable and future releases, please try it out! https://search.nixos.org/options?channel=unstable&show=services.keter.enable&from=0&size=50&sort=relevance&type=packages&query=keter – Jappie Kerk Sep 13 '22 at 22:02

1 Answers1

1

exec is actually a shell built-in, not a coreutils command. Actually the createProcess error message is confusing. The command name that can't be found comes before the createProcess:. So the problem is not that pprjam can not find exec (as a command), but createProcess detected a failed exec system call.

It seems that /opt/keter/temp/pprjam-0/dist/bin/pprjam is missing on your server, or the runtime linker can not find pprjam's dependencies. If the latter is the case, you may be able to fix it by extending the LD_LIBRARY_PATH environment variable of the Keter service.

Robert Hensing
  • 6,708
  • 18
  • 23
  • Ooh, that makes sense. `pprjam` depends on `libpqxx`, but can't find it. I guess I just need to use `nix-copy-closure` to deploy `pprjam` and setup nginx as a frontend webserver instead of keter. – Ben Feb 04 '18 at 08:05
  • That's probably a better solution. Although keter is quite simple, it expect it to provide little benefit. Its killer feature, zero-downtime redeploys, can also be achieved with systemd socket activation. – Robert Hensing Feb 05 '18 at 10:32
  • Zero-downtime redeploys was what I wanted it for most of all. I'm not familiar with "systemd socket activation" but I will research it, thanks! – Ben Feb 05 '18 at 16:50