Implemented restart service

Implemented an OS and environment safe restart service. This works by
running Home Assistant in a child process. If the child process
terminates with an exit code > 0, HASS is restarted. SIGTERM and
KeyboardInterrupts to the parent process are forwarded to the child
process. KeyboardInterrupts will only be forwarded once. The second
KeyboardInterrupt will be handled by the parent.
This commit is contained in:
Ryan Kraus committed 2016-01-26 22:39:59 -05:00
1 parent 14cd27aaa7
commit b596fa33d6
3 files changed
+75 -28

No files matched your search

+1 -1
View File
@@ -10,7 +10,6 @@ MATCH_ALL = '*'
DEVICE_DEFAULT_NAME = "Unnamed Device"
# #### CONFIG ####
CONF_ICON = "icon"
CONF_LATITUDE = "latitude"
CONF_LONGITUDE = "longitude"
CONF_TEMPERATURE_UNIT = "temperature_unit"
@@ -124,6 +123,7 @@ ATTR_GPS_ACCURACY = 'gps_accuracy'
# #### SERVICES ####
SERVICE_HOMEASSISTANT_STOP = "stop"
SERVICE_HOMEASSISTANT_RESTART = "restart"
SERVICE_TURN_ON = 'turn_on'
SERVICE_TURN_OFF = 'turn_off'