jed
Hey all
I have a small elixir program compiled using Distillery 2.0 that I want to run whenever my computer boots up.
I figured it would be straight forward because it would just be running “./bin/app start” in a service, however I get the following error(s):
sudo journalctl -xe
>-- Subject: Unit zofi.service has finished start-up
>-- Defined-By: systemd
>-- Support: http://www.ubuntu.com/support
>--
>-- Unit zofi.service has finished starting up.
>--
>-- The start-up result is RESULT.
> Nov 28 15:51:51 jed-nuc7i3-04 zofi[900]: erlexec: HOME must be set
> Nov 28 15:51:51 jed-nuc7i3-04 zofi[900]: Unusable Erlang runtime system! This is likely due to being compiled for another system than the host is running
> Nov 28 15:51:51 jed-nuc7i3-04 systemd[1]: zofi.service: Main process exited, code=exited, status=1/FAILURE
> Nov 28 15:51:51 jed-nuc7i3-04 systemd[1]: zofi.service: Failed with result 'exit-code'.
-erlexec: HOME must be set
Not sure where to begin here since I haven’t seen references to ‘erlexec’ in the Distillery docs thus far.
-Unusable Erlang runtime system! This is likely due to being compiled for another system than the host is running
This is also a strange one because I’m deploying it on the same computer it was made.
Maybe I’m missing something obvious here. Any ideas?
Other Info:
OS: Ubuntu 18.04.1 LTS
Elixir 1.7.4 (compiled with Erlang/OTP 20)
Distillery version 2.0.12
rel/config.exs - Using defaults.
The service: https://pastebin.com/ZJHEikFt
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #elixirconf-us
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
NobbZ
How are you as a developer managing your erlang and elixir version? Are you using those provided by
aptor are you usingkiex,kerl,asdf, or something similar?If the latter, make sure you use the
aptinstalled version when building the release or create an environment using the tools which is usable bysystemd.I’m not sure about
HOMEanderlexecthough…alco
Make sure you have
set include_erts: truein your release config, this may fix the second warning.erlexecis Erlang’s underlying binary, it starts the whole system up when you runerl. Distillery’s docs recommend usingforegroundinstead ofstarthere, I’d try that.UPDATE: Just to elaborate a bit on
erlexec, for posterity:OvermindDL1
You should look at my PidFile - create and manage a PID file from the BEAM process thread, I have a systemd service description there that works well and I’ve been using for over a year now. You don’t need
pid_fileitself now as I think Distillery 2 baked in it’s functionality now, but check it’s docs to make sure (and to get the path to use).pid_filestill works fine otherwise (I’m still using it).jed
Thanks everyone.
Turns out I just needed to run
mix releasewithMIX_ENV=prodto compile to a proper production version withset_include_ertsset totrue. When previously I was just including the flag--env=prod, thinking it was sufficient.jed
Cool project. I might check this out if my little project grows into into something non-trivial
sahilpaudel
I did the same but still getting