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

app-misc/homeassistant-bin #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

app-misc/homeassistant-bin #2

wants to merge 3 commits into from

Conversation

rdnetto
Copy link
Contributor

@rdnetto rdnetto commented Apr 11, 2018

This PR makes the following changes to the homeassistant-bin ebuild:

  • adds a systemd unit file
  • unsets the write bit on the installed files (for security)
  • unsets KEYWORDS in the 9999 version - since installing this means that portage won't automatically update homeassistant to later versions, users should have to opt-in to it by explicitly unkeywording it.

@lmiphay
Copy link
Owner

lmiphay commented Apr 14, 2018

Thanks for the PR @rdnetto

The systemd unit and KEYWORDS changes both LGTM

I think the write bit change will break various ways homeassistant configures itself (which it persists itself to files in /etc/homeassistant) and e.g. things like the automation editor (https://www.home-assistant.io/docs/automation/editor/). It would be good to lock down these config files somehow, but I am not sure there is anyway around this?

At a later stage it might be nice to add systemctl stop/start or restart support to the included update-homeassistant script (installed from the filesdir) - just for consistency, but there is no requirement to use it.

I will also copy to the systemd unit file to the work-in-progress non-bin app-misc/homeassistent ebuild when I get back to it (to keep them in somewhat in sync).

Type=simple
User=homeassistant
ExecStart=/opt/homeassistant/bin/hass --log-file /var/log/homeassistant/homeassistant.log $HASS_OPTS
EnvironmentFile=/etc/conf.d/homeassistant
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably split this configuration file from the openrc one as well (see: https://wiki.gentoo.org/wiki/Project:Systemd/conf.d_files)

@lmiphay
Copy link
Owner

lmiphay commented Apr 14, 2018

For the 0.67.0 version bump, I cherry picked:

  1. 8ed4ad3 Added systemd service
  2. bdb98d5 Don't set KEYWORDS on 9999

@lmiphay
Copy link
Owner

lmiphay commented Apr 28, 2018

For the 0.68.0 version bump, I:

  1. removed the unit file dependency on the openrc conf file (hardwired as per what is apparently best practice).
  2. moved the config directory location back into the openrc init script
  3. updated the gentoo readme a bit to mention openrc specific bits

I don't think any of the above should break running under systemd - let me know if did however...

Still todo:

  1. make the update script systemd aware
  2. consider moving the the config directory to /var/lib/homeassistant
  3. copy the unit file to the non-bin version work-in-progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants