Installing on Synology NAS without docker

Hi folks,

first of all i want to make a excuse for my bad english.
I hope you’ll get the point anyways.

I succsessfully (?) installed home-assistant on my DS 411 with
DSM 6.0.2-8451. i uploaded the file “hass-daemon” containing the following code :slight_smile:
#!/bin/sh

# Package
PACKAGE="homeassistant"
DNAME="Home Assistant"

# Others
USER="homeassistant"
PYTHON_DIR="/volume1/@appstore/py3k/usr/local/bin"
PYTHON="$PYTHON_DIR/python3"
HASS="$PYTHON_DIR/hass"
INSTALL_DIR="/volume1/homeassistant"
PID_FILE="$INSTALL_DIR/home-assistant.pid"
FLAGS="-v --config $INSTALL_DIR --pid-file $PID_FILE --daemon"
REDIRECT="> $INSTALL_DIR/home-assistant.log 2>&1"

start_daemon ()
{
sudo -u ${USER} /bin/sh -c "$PYTHON $HASS $FLAGS $REDIRECT;"
}

stop_daemon ()
{
kill `cat ${PID_FILE}`
wait_for_status 1 20 || kill -9 `cat ${PID_FILE}`
rm -f ${PID_FILE}
}

daemon_status ()
{
if [ -f ${PID_FILE} ] && kill -0 `cat ${PID_FILE}` > /dev/null 2>&1; then
    return
fi
rm -f ${PID_FILE}
return 1
}

wait_for_status ()
{
counter=$2
while [ ${counter} -gt 0 ]; do
    daemon_status
    [ $? -eq $1 ] && return
    let counter=counter-1
    sleep 1
done
return 1
}

case $1 in
start)
    if daemon_status; then
        echo ${DNAME} is already running
        exit 0
    else
        echo Starting ${DNAME} ...
        start_daemon
        exit $?
    fi
    ;;
stop)
    if daemon_status; then
        echo Stopping ${DNAME} ...
        stop_daemon
        exit $?
    else
        echo ${DNAME} is not running
        exit 0
    fi
    ;;
    restart)
    if daemon_status; then
        echo Stopping ${DNAME} ...
        stop_daemon
        echo Starting ${DNAME} ...
        start_daemon
        exit $?
    else
        echo ${DNAME} is not running
        echo Starting ${DNAME} ...
        start_daemon
        exit $?
    fi
    ;;
status)
    if daemon_status; then
        echo ${DNAME} is running
        exit 0
    else
        echo ${DNAME} is not running
        exit 1
    fi
    ;;
log)
    echo ${LOG_FILE}
    exit 0
    ;;
*)
    exit 1
    ;;
esac

then i did the following :

root@DServer:/volume1/homeassistant# chown -R homeassistant:users /volume1/homeassistant
root@DServer:/volume1/homeassistant# chmod -R 664 /volume1/homeassistant
root@DServer:/volume1/homeassistant# chmod 777 /volume1/homeassistant/hass-daemon
root@DServer:/volume1/homeassistant# sudo /volume1/homeassistant/hass-daemon start
sudo: unable to execute /volume1/homeassistant/hass-daemon: No such file or directory

hmh. i dont get why the error appears. Ok trying something diffrent

admin@DServer:/$ ./volume1/homeassistant/hass-deamon
-sh: ./volume1/homeassistant/hass-deamon: Permission denied
admin@DServer:/$ sudo ./volume1/homeassistant/hass-deamon
Password:
sudo: ./volume1/homeassistant/hass-deamon: command not found

Okay so… usual “admin” does not have access. tried it with sudo. file not found.
Never have had this bad problems on windows tho :smiley:

hope some1 can help me with this problem.
i tried to search youtube and other websites.
they’re only explaining how to install with docker.

You have the same problem I have. If you run:
cd /volume1/homeassistant
ls -la
That will show you the permissions for the hass-daemon file. Thread on that here Installing on Synology DS216j - hass-daemon: command not found

Mine looks like this which is wrong and it’s because I created the file in Notepad++ then uploaded it to the homeassistant folder using File Station as I suck using Vi.

Unfortunately, I don’t know how to fix the permissions issue.

Any luck getting this resolved?

Hi, I have exact same problem on DS216J (x86) (and I can’t use Docker on 32bits NAS)

hava a solution ?