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

Fails only when run by systemd #58

Open
doronbehar opened this issue Apr 29, 2020 · 1 comment
Open

Fails only when run by systemd #58

doronbehar opened this issue Apr 29, 2020 · 1 comment

Comments

@doronbehar
Copy link

I'm getting this error:

mpdas[4887]: terminate called after throwing an instance of 'std::logic_error'
mpdas[4887]:   what():  basic_string::_M_construct null not valid

Only when I run mpdas inside a systemd service. But when I run it manually I don't get it :/

Any idea how to debug this? Google didn't help much...

@doronbehar
Copy link
Author

Hey @hrkfdn,

I think the problem is this line:

mpdas/main.cpp

Line 103 in c81c480

std::string home = getenv("HOME");

main.cpp assumes this environmental variable is set, while it isn't set in system-wide systemd services. Hence the fix that worked for me was to add:

[Service]
Environment="HOME=/home/doron"

To my mpdas.service.

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

1 participant