mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00: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:
parent
01daac066a
commit
135eb0a0ac
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user