Getting "Permission Denied" When Trying to Auto-Start (HA Works Great Otherwise!)

I’m very new to HA, and absolutely loving it so far, however I’ve run into an issue trying to get auto-start setup and I just can’t get it figured out. I’ve tried some things on my own, and I’ve done some searching, but nothing seems to work. I’m not sure if it’s a good or bad thing that I can’t seem to find a single other person that’s had this exact issue with HA.

I’m running Fedora via VirtualBox in Windows, and HA in a Python virtual environment.

I’ve followed the steps here, https://www.home-assistant.io/docs/autostart/systemd/, but no matter what I try I keep getting, “Failed to execute command: Permission denied” in systemctl.

[email protected] - Home Assistant
   Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2018-11-24 19:48:18 PST; 11min ago
  Process: 3569 ExecStart=/srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant (code=exited, status=203/EXEC)
 Main PID: 3569 (code=exited, status=203/EXEC)

Nov 24 19:48:18 hass.mydomain.com systemd[1]: Started Home Assistant.
Nov 24 19:48:18 hass.mydomain.com systemd[3569]: [email protected]: Failed to execute command: Permission denied
Nov 24 19:48:18 hass.mydomain.com systemd[3569]: [email protected]: Failed at step EXEC spawning /srv/homeassistant/bin/hass: Permission denied
Nov 24 19:48:18 hass.mydomain.com systemd[1]: [email protected]: Main process exited, code=exited, status=203/EXEC
Nov 24 19:48:18 hass.mydomain.com systemd[1]: [email protected]: Failed with result 'exit-code'.

The permissions of the file that seems to be having the issue:
-rwxrwxr-x. 1 homeassistant homeassistant 239 Nov 21 16:11 /srv/homeassistant/bin/hass

My service file:

[Unit]
Description=Home Assistant
After=network-online.target

[Service]
Type=simple
User=%i
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"

[Install]
WantedBy=multi-user.target

Does anyone have a clue what might be going on here? The system works great otherwise, I just can’t seem to get auto-start working.

From some very quick and scratchy googling this looks like a security protocol in Fedora causing you an issue, try editing /etc/selinux/config and changing the line

SELINUX = enforcing

to

SELINUX = permissive

Fantastic! That did it!

Do you happen to remember what you searched for? Obviously I need to up my google game.

Appreciate the help!

Try this:

  1. cd /etc/systemd/system/
  2. ls -Zal (look for the existing labels on syslog for example)
  3. chcon system_u:object_r:systemd_unit_file_t:s0 [email protected]