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

Error message - autostart #1723

Closed
riaandeyzel opened this issue Apr 6, 2016 · 4 comments
Closed

Error message - autostart #1723

riaandeyzel opened this issue Apr 6, 2016 · 4 comments

Comments

@riaandeyzel
Copy link

Home Assistant release (hass --version):

0.16.1
Python release (python3 --version):
3.4.2

Component/platform:
Raspberry Pi B - Raspbian Jessie

Description of problem:
error when following this guide (Systemd) Daemon : https://home-assistant.io/getting-started/autostart/ HA does auto start though, but might not load some services?

root@raspberrypi:~# systemctl status home-assistant@root -l
â home-assistant@root.service - Home Assistant for root
   Loaded: loaded (/lib/systemd/system/home-assistant@root.service; enabled)
   Active: failed (Result: exit-code) since Wed 2016-04-06 12:31:55 SAST; 9min ago
  Process: 1104 ExecStart=/usr/bin/hass --config %h/.homeassistant/ (code=exited, status=203/EXEC)
 Main PID: 1104 (code=exited, status=203/EXEC)

Apr 06 12:31:54 raspberrypi systemd[1]: Started Home Assistant for root.
Apr 06 12:31:54 raspberrypi systemd[1104]: Failed at step EXEC spawning /usr/bin/hass: No such file or directory
Apr 06 12:31:55 raspberrypi systemd[1]: home-assistant@root.service: main process exited, code=exited, status=203/EXEC
Apr 06 12:31:55 raspberrypi systemd[1]: Unit home-assistant@root.service entered failed state.

@fabaff
Copy link
Member

fabaff commented Apr 6, 2016

@gieljnssns
Copy link
Contributor

I'm also having autostart problems.

pi@raspberrypi:~ $ sudo su -c 'cat <<EOF >> /lib/systemd/system/home-assistant@pi.service
> [Unit]
> Description=Home Assistant
> After=network.target
> 
> [Service]
> Type=simple
> # Next line is to run as a specific user
> # for Raspberry Pi users, keep it at ‘pi’
> User=%i
> ExecStart=/usr/local/bin/hass
> 
> [Install]
> WantedBy=multi-user.target
> EOF'
pi@raspberrypi:~ $ sudo systemctl --system daemon-reload
pi@raspberrypi:~ $ sudo systemctl enable home-assistant@pi
pi@raspberrypi:~ $ sudo systemctl start home-assistant@pi
Failed to start home-assistant@pi.service: Unit home-assistant@pi.service failed to load: Invalid argument. See system logs and 'systemctl status home-assistant@pi.service' for details.
pi@raspberrypi:~ $ sudo systemctl start home-assistant
Failed to start home-assistant.service: Unit home-assistant.service failed to load: Bad message. See system logs and 'systemctl status home-assistant.service' for details.
pi@raspberrypi:~ $ systemctl status home-assistant@pi.service
● home-assistant@pi.service - Home Assistant
   Loaded: error (Reason: Invalid argument)
   Active: failed (Result: resources)
pi@raspberrypi:~ $ systemctl status home-assistant.service
● home-assistant.service - Home Assistant
   Loaded: error (Reason: Bad message)
   Active: inactive (dead)
pi@raspberrypi:~ $ sudo systemctl start home-assistant@pi
Failed to start home-assistant@pi.service: Unit home-assistant@pi.service failed to load: Invalid argument. See system logs and 'systemctl status home-assistant@pi.service' for details.
pi@raspberrypi:~ $ sudo systemctl status home-assistant@pi -l
● home-assistant@pi.service - Home Assistant
   Loaded: error (Reason: Invalid argument)
   Active: failed (Result: resources)

Apr 05 12:52:04 raspberrypi systemd[1]: Starting Home Assistant for pi...
Apr 05 12:52:04 raspberrypi systemd[1]: home-assistant@pi.service failed to run 'start' task: Operation not supported
Apr 05 12:52:04 raspberrypi systemd[1]: Failed to start Home Assistant for pi.
Apr 05 12:52:04 raspberrypi systemd[1]: Unit home-assistant@pi.service entered failed state.
Apr 07 09:11:15 raspberrypi systemd[1]: [/lib/systemd/system/home-assistant@pi.service:10] Failed to resolve unit specifiers on %h, ignoring: Operation not supported
Apr 07 09:11:15 raspberrypi systemd[1]: home-assistant@pi.service has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.
Apr 07 09:11:28 raspberrypi systemd[1]: [/lib/systemd/system/home-assistant@pi.service:10] Failed to resolve unit specifiers on %h, ignoring: Operation not supported
Apr 07 09:11:28 raspberrypi systemd[1]: home-assistant@pi.service has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.
pi@raspberrypi:~ $ sudo ap-get install python-pip3
sudo: ap-get: command not found
pi@raspberrypi:~ $ sudo apt-get install python-pip3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python-pip3

@gieljnssns
Copy link
Contributor

pi@raspberrypi:~ $ whereis hass
hass: /usr/local/bin/hass

@gieljnssns
Copy link
Contributor

I've fixed it, I used:

[Unit]
Description=Home Assistant for %i
After=network.target

[Service]
Type=simple
# Next line is to run as a specific user
# for Raspberry Pi users, keep it at ‘pi’
User=%i
ExecStart=/usr/local/bin/hass
SendSIGKILL=no

[Install]
WantedBy=multi-user.target

@fabaff fabaff closed this as completed in c210242 Apr 9, 2016
balloob added a commit that referenced this issue Apr 9, 2016
* We need to allow extra keys on top level componenet config

fixes #1756

* Add comment about location of hass (fixes #1723)

* Fix for MQTT config validation on the protocol field. (#1765)

* Update frontend with weblink fix

* Fix for light service validation. (#1770)

Incorrect validation tested if passed value was a list instead of
a member of the list.

* Accept group without entities in configuration. (#1768)

* Accept group without entities in configuration.

People seem to use these as placeholders for future expansion of their
home automation dreams, and we used to accept them.  We still have to
specify at least one of 'name', 'view' or 'icon' so that the group is
parsed as a dictionary.

* Also accept empty entities: key in a group.

* Additional fix for empty entities value in a group config.

* Version bump to 0.17.1
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants