mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 03:35:09 +02:00
Fixed hass daemon management
1) Changed signal to exit hass to SIGTERM 2) Updated initd script to send SIGTERM 3) Updated systemd script to never send SIGKILL.
This commit is contained in:
@@ -84,7 +84,7 @@ class HomeAssistant(object):
|
||||
|
||||
if os.name != "nt":
|
||||
try:
|
||||
signal.signal(signal.SIGQUIT, stop_homeassistant)
|
||||
signal.signal(signal.SIGTERM, stop_homeassistant)
|
||||
except ValueError:
|
||||
_LOGGER.warning(
|
||||
'Could not bind to SIGQUIT. Are you running in a thread?')
|
||||
|
@@ -53,7 +53,7 @@ stop() {
|
||||
return 1
|
||||
fi
|
||||
echo 'Stopping service…' >&2
|
||||
kill -3 $(cat "$PID_FILE")
|
||||
kill $(cat "$PID_FILE")
|
||||
while ps -p $(cat "$PID_FILE") > /dev/null 2>&1; do sleep 1;done;
|
||||
echo 'Service stopped' >&2
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ Type=simple
|
||||
User=%i
|
||||
WorkingDirectory=%h
|
||||
ExecStart=/usr/bin/hass --config %h/.homeassistant/
|
||||
SendSIGKILL=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Reference in New Issue
Block a user