nroi
Hi,
If I start the build with _build/prod/rel/projectname/bin/projectname foreground and then stop it with _build/prod/rel/projectname/bin/projectname stop I get the error message: “Node is not running!” and the exit code 1. The shutdown seems to work nonetheless, at least I don’t see any beam processes other than epmd lurking around, but I don’t want to just ignore the error since I use systemd to start and stop the processes. If processes exit with a non-zero exit code, systemd marks the unit as failed.
Perhaps the foreground option is not meant to be used with the stop command, but sending SIGINT or SIGTERM to the process instead doesn’t solve my problem either: The error message “Node ist not running!” disappears, but I still get a non-zero exit code. Starting the process with “start” instead of foreground is also not an option, since I want the log messages to appear in my systemd journal.
I’d appreciate any advice to solve this without workarounds such as adding SuccessExitStatus= to the systemd service file.
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
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
bitwalker
stopis meant as a counterpart tostart- in my own applications where I useforegroundI sendSIGTERMto thebin/projectnamescript process, not thebeam.smpprocess. This is because the script sets up a trap to ensure the application terminates gracefully. If you sendSIGTERMdirectly to thebeam.smpprocess, it will shutdown, but not gracefully, and the trap will then be executed which is what is generating theNode is not runningmessage (because it can’t rpc to the node to tell it to stop).nroi
I see. In that case, I suppose adding
SuccessExitStatus=143to the systemd service file is the best solution. I thought it was more of a workaround than a fix, but it seems this is a common approach for Java applications as well.