Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mattiasw2 opened this issue Mar 28, 2022 · 10 comments

Comments

@mattiasw2
Copy link

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.

@hauleth
Copy link
Owner

hauleth commented Mar 28, 2022

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

@mattiasw2
Copy link
Author

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

@mattiasw2
Copy link
Author

Could it be that erlang is installed using snap?

@hauleth
Copy link
Owner

hauleth commented Mar 30, 2022

Could you publish the unit file as well?

@mattiasw2
Copy link
Author

mattiasw2 commented Mar 30, 2022

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'.

@hauleth
Copy link
Owner

hauleth commented Mar 30, 2022

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?

@mattiasw2
Copy link
Author

mattiasw2 commented Mar 30, 2022 via email

@mattiasw2
Copy link
Author

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...

@mattiasw2
Copy link
Author

mattiasw2 commented Apr 29, 2022

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

@hauleth
Copy link
Owner

hauleth commented Apr 29, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants