mpdas
mpdas copied to clipboard
Fails only when run by systemd
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...
Hey @hrkfdn,
I think the problem is this line:
https://github.com/hrkfdn/mpdas/blob/c81c480a6081af104c70c3574fb71319ff1521b7/main.cpp#L103
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
.