hauleth / erlang-systemd

systemd utilities for Erlang applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When you say "ExecStart=/path/to/my_app start" do mean something like /rel/share3/bin/share3 start?

mattiasw2 opened this issue · comments

Where

/rel/share3/bin/share3 start

is created using "rebar3 release".

I never got this to work, get some protocol error when I do "systemctl start share3"

Using ubuntu 20.04 with Erl22.

What kind of error? Can you paste that error? And yes, I mean't the path to your release binary runner.

Made a tiny test project at https://github.com/mattiasw2/systemdtest/tree/main/systemdtest which only creates 2 log file entries.

Could it be that erlang is installed using snap?

Could you publish the unit file as well?

What is the unit file? Do you mean the unit referred to in journalctl? The only meaningful error message is

systemdtest.service: Failed with result 'protocol'.

In your case systemdtest.service.

And the error seems peculiar. I will take a closer look into it. Can you also give me version of your systemd installation?

Would really be nice if someone could tell me what's wrong with this app. Is it the systemd:notify(ready), that is in the wrong place or...

I can get this simple systemd file to work, the most important change it to use Type=simple, which is good enough for me, since Erlang so stable.

Description=My Awesome App
After=network.target

[Service]
User=root
WorkingDirectory=/root/data7/systemdtest/systemdtest/_build/default/rel/myrel
Type=simple
ExecStart=/root/data7/systemdtest/systemdtest/_build/default/rel/myrel/bin/myrel daemon
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

I have longer weekend now so I will try to handle that this weekend. Sorry, I was occupied with my day job and I had little time to spare on this one.