Can't find config file in systemd init to autostart HA

I’m trying to autostart HA with systemd and so far it works but it loads without the config. I added the config parameter to my systemd service but I get an error saying it couldn’t find the config file even though it’s there.

Location of file:

root@raspberrypi:~/.homeassistant# pwd
/root/.homeassistant
root@raspberrypi:~/.homeassistant# ls
configuration.yaml deps home-assistant.log home-assistant_v2.db

Service file:

ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass --config “/root/.homeassistant”

Error:

[email protected] - Home Assistant for homeassistant
Loaded: loaded (/etc/systemd/system/[email protected]; enabled)
Active: failed (Result: exit-code) since Fri 2016-09-16 09:36:39 UTC; 4s ago
Process: 1877 ExecStart=/srv/homeassistant/homeassistant_venv/bin/hass --config /root/.homeassistant (code=exited, status=1/FAILURE)
Main PID: 1877 (code=exited, status=1/FAILURE)

Sep 16 09:36:37 raspberrypi systemd[1]: Started Home Assistant for homeassistant.
Sep 16 09:36:38 raspberrypi hass[1877]: Fatal Error: Specified configuration directory does not exist /root/.homeassistant
Sep 16 09:36:39 raspberrypi systemd[1]: [email protected]: main process exited, code=exited, status=1/FAILURE
Sep 16 09:36:39 raspberrypi systemd[1]: Unit [email protected] entered failed state.

Launching it like this works fine:

root@raspberrypi:~# /srv/homeassistant/homeassistant_venv/bin/hass --config /root/.homeassistant
Config directory: /root/.homeassistant
16-09-16 09:54:59 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_off>

How can I fix this?

I fixed it! I changed the path to /home/homeassistant/.homeassistant where there seems to be another configuration.yaml file. I guess it was a problem with root permissions? Anyone care to elaborate?

if you are running HASS as its own user, as you always should, then that user does not have permission to /root.