Skip to content

Commit 970acbb

Browse files
dagobertfabaff
authored andcommitted
Make init script raspi-proof (home-assistant#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.
1 parent 5accd4b commit 970acbb

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

source/_docs/autostart/init.d.markdown

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ FLAGS="-v --config $CONFIG_DIR --pid-file $PID_FILE --log-file $LOG_FILE --daemo
9494

9595

9696
start() {
97-
if [ ! -d "$PID_DIR" ]; then
98-
echo "It seems you did not run"
99-
echo -e "\tservice hass-daemon install"
100-
return 1
101-
fi
97+
create_piddir
10298
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then
10399
echo 'Service already running' >&2
104100
return 1
@@ -218,11 +214,7 @@ LOG_FILE="$LOG_DIR/home-assistant.log"
218214
FLAGS="-v --config $CONFIG_DIR --pid-file $PID_FILE --log-file $LOG_FILE --daemon"
219215

220216
start() {
221-
if [ ! -d "$PID_DIR" ]; then
222-
echo "It seems you did not run"
223-
echo -e "\tservice hass-daemon install"
224-
return 1
225-
fi
217+
create_piddir
226218
if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then
227219
echo 'Service already running' >&2
228220
return 1

0 commit comments

Comments
 (0)