mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-08 09:56:52 +00:00
Make init script raspi-proof (#4459)
Raspbian does not keep files in /run. Therefor the pid directory needs to be created every time after boot. The easies is to put this into the start function. Sorry, I did not test the patch with all my legacy systems.
This commit is contained in:
parent
5accd4b0d8
commit
970acbb40b
@ -94,11 +94,7 @@ FLAGS="-v --config $CONFIG_DIR --pid-file $PID_FILE --log-file $LOG_FILE --daemo
|
|||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
if [ ! -d "$PID_DIR" ]; then
|
create_piddir
|
||||||
echo "It seems you did not run"
|
|
||||||
echo -e "\tservice hass-daemon install"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then
|
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then
|
||||||
echo 'Service already running' >&2
|
echo 'Service already running' >&2
|
||||||
return 1
|
return 1
|
||||||
@ -218,11 +214,7 @@ LOG_FILE="$LOG_DIR/home-assistant.log"
|
|||||||
FLAGS="-v --config $CONFIG_DIR --pid-file $PID_FILE --log-file $LOG_FILE --daemon"
|
FLAGS="-v --config $CONFIG_DIR --pid-file $PID_FILE --log-file $LOG_FILE --daemon"
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
if [ ! -d "$PID_DIR" ]; then
|
create_piddir
|
||||||
echo "It seems you did not run"
|
|
||||||
echo -e "\tservice hass-daemon install"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then
|
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then
|
||||||
echo 'Service already running' >&2
|
echo 'Service already running' >&2
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user