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

Kelvin failing to run on boot #38

Closed
KevRooster opened this issue Jun 17, 2018 · 11 comments
Closed

Kelvin failing to run on boot #38

KevRooster opened this issue Jun 17, 2018 · 11 comments
Assignees

Comments

@KevRooster
Copy link

I followed the instructions to use systemd to run kelvin on bootup on a Rasperry Pi. However, Kelvin fails to run on bootup. The Kelvin Logs look like this:

-- Logs begin at Sat 2018-06-16 20:03:03 CDT. --
Jun 16 20:03:07 raspberrypi systemd[1]: Started Kelvin.
Jun 16 20:03:08 raspberrypi kelvin[413]: time="2018/16/06 20:03:08" level=info msg="Kelvin v1.1.6 starting up... 🚀"
Jun 16 20:03:08 raspberrypi kelvin[413]: time="2018/16/06 20:03:08" level=info msg="⚙ Configuration config.json loaded"
Jun 16 20:03:08 raspberrypi systemd[1]: kelvin.service: Main process exited, code=exited, status=1/FAILURE
Jun 16 20:03:08 raspberrypi systemd[1]: kelvin.service: Unit entered failed state.
Jun 16 20:03:08 raspberrypi systemd[1]: kelvin.service: Failed with result 'exit-code'.

Any ideas as to what the problem might be?

@stefanwichmann
Copy link
Owner

Hi KevRooster,

have you tried running Kelvin directly from the shell without using systemd? Does it crash there too?

If you can, please run ./kelvin -debug and paste the output here. Thanks!

@stefanwichmann stefanwichmann self-assigned this Jun 29, 2018
@KevRooster
Copy link
Author

KevRooster commented Jun 30, 2018 via email

@stefanwichmann
Copy link
Owner

Thanks for the follow up.

The last line of your output gives a hint to what might be the problem here: Kelvin can't write the changed configuration to disk because of missing permissions.

Could you paste the output of running ls -lha /home/pi/kelvin/config.json?

I would guess the config belongs to root and your normal user doesn't have the right to write to this file. You can fix this by running chown $USER /home/pi/kelvin/config.json.

Hope this helps!

@KevRooster
Copy link
Author

KevRooster commented Jun 30, 2018 via email

@stefanwichmann
Copy link
Owner

Ok, the file permissions seem to be ok.

Next we should make sure you are in the correct working directory. Please execute:

cd /home/pi/kelvin/
./kelvin -debug

This should make sure you are really using the config file from /home/pi/kelvin/.

@KevRooster
Copy link
Author

KevRooster commented Jul 8, 2018 via email

@stefanwichmann
Copy link
Owner

This looks much better. So there seems to be a Kelvin configuration file somewhere on your system with the wrong permissions. This file seems to get used if you start Kelvin via systemd.

I just released Kelvin v1.1.8 which will print the absolute paths of the binary and configuration file. This should lead us to the source of the problem.

@KevRooster
Copy link
Author

KevRooster commented Jul 17, 2018 via email

@stefanwichmann
Copy link
Owner

stefanwichmann commented Jul 18, 2018

Thanks for updating to the latest version. Now we can identify which configuration file Kelvin wants to write to once it was started via systemd.

Please paste the output of journalctl -u kelvin and sudo journalctl -u kelvin. These commands should print the output of the process started by systemd.

@KevRooster
Copy link
Author

KevRooster commented Jul 20, 2018 via email

@stefanwichmann
Copy link
Owner

Sorry, we missed activating the debug output. Please add the -debug flag to the ExecStart line inside /etc/systemd/system/kelvin.service. It should look like this:

ExecStart=/home/pi/kelvin/kelvin -debug

After this exec sudo systemctl restart kelvin for the changes to take effect. Then we should have another look at the output of journalctl -u kelvin

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