Closed zacksiri closed 1 week ago
So I managed to find the fix for this. In systemd there is a setting called IgnoreSIGPIPE
which needs to be set to false
and it will resolve this issue.
There is more explanation here: https://stackoverflow.com/questions/44358723/systemd-unit-file-never-finishes-when-using-a-shell-command-with-pipes
Here is an example:
[Unit]
Description=Livebook startup
After=network.target
[Service]
IgnoreSIGPIPE=false
User=root
Group=root
Environment="PATH=/root/.asdf/shims:/root/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Environment="LIVEBOOK_IP=0.0.0.0"
Environment="LIVEBOOK_PASSWORD=changeme"
Environment="MIX_ENV=prod"
Environment="LIVEBOOK_CACERTFILE=/etc/ssl/certs/ca-certificates.crt"
# Environment="LIVEBOOK_IDENTITY_PROVIDER=tailscale:/var/run/tailscale/tailscaled.sock"
ExecStart=/root/livebook/_build/prod/rel/livebook/bin/livebook start
[Install]
WantedBy=multi-user.target
Environment
_build/prod/rel/livebook/bin/livebook start
via systemdgit rev-parse HEAD
if running with mix): 85e2cd336d25e6be4942a557775430be09a52fbfCurrent behavior
I started my livebook using systemd so that when i start my OS livebook automatically starts. Now when I start the app with systemd I notice the following:
Expected behavior
Livebook starts normally:
Analysis
To get livebook to start normally I had to replace the following line:
in the file:
_build/prod/rel/livebook/releases/0.14.0-dev/env.sh
there was a line with the following:I replaced this with:
and everything works normally.
I noticed that the problem is here: https://github.com/livebook-dev/livebook/blob/main/rel/server/env.sh.eex
Any chance we can change the implementation to be friendly with systemd?