[FATAL tini (16)] exec ./start.sh failed: Exec format error when using synology docker image

  • Platform information:
    • Hardware: synology DS1816+
    • OS: synology docker 17.05.0-0395
    • Java Runtime Environment: part of offical docker image
    • openHAB version: 2.4.0-amd64-alpine
  • can’t start following the docker official instruction
  • no configuration yet
  • below is a full log from start to end in reverse order generated by docker. I don’t understand what’s the start.sh and what should be in the file. It didn’t mentioned in the openhab docker document. I just put the " Running the Container as a Service Managed by Docker" in it.
    https://www.openhab.org/docs/installation/docker.html

thx

2019-03-11 13:36:37 stdout [FATAL tini (16)] exec ./start.sh failed: Exec format error
2019-03-11 13:36:37 stdout + exec su-exec openhab tini -s ./start.sh
2019-03-11 13:36:37 stdout + ‘[’ true == false ‘]’
2019-03-11 13:36:37 stdout + sync
2019-03-11 13:36:37 stdout + chown -R openhab:openhab /openhab
2019-03-11 13:36:37 stdout + ‘[’ -d /etc/cont-init.d ‘]’
2019-03-11 13:36:37 stdout transform’ ‘]’
2019-03-11 13:36:37 stdout things
2019-03-11 13:36:37 stdout sounds
2019-03-11 13:36:37 stdout sitemaps
2019-03-11 13:36:37 stdout services
2019-03-11 13:36:37 stdout scripts
2019-03-11 13:36:37 stdout rules
2019-03-11 13:36:37 stdout persistence
2019-03-11 13:36:37 stdout items
2019-03-11 13:36:37 stdout icons
2019-03-11 13:36:37 stdout + ‘[’ -z 'html
2019-03-11 13:36:37 stdout ++ ls -A /openhab/conf
2019-03-11 13:36:37 stdout + ‘[’ ‘!’ -z ‘]’
2019-03-11 13:36:37 stdout cmp: /openhab/userdata.dist/etc/version.properties: No such file or directory
2019-03-11 13:36:37 stdout ++ cmp /openhab/userdata/etc/version.properties /openhab/userdata.dist/etc/version.properties
2019-03-11 13:36:37 stdout tmp’ ‘]’
2019-03-11 13:36:37 stdout logs
2019-03-11 13:36:37 stdout jsondb
2019-03-11 13:36:37 stdout etc
2019-03-11 13:36:37 stdout config
2019-03-11 13:36:37 stdout + ‘[’ -z 'cache
2019-03-11 13:36:37 stdout ++ ls -A /openhab/userdata
2019-03-11 13:36:37 stdout + case ${OPENHAB_VERSION} in
2019-03-11 13:36:37 stdout + id -u openhab
2019-03-11 13:36:37 stdout Starting with openhab user id: 9001 and group id: 9001
2019-03-11 13:36:37 stdout + echo ‘Starting with openhab user id: 9001 and group id: 9001’
2019-03-11 13:36:37 stdout + NEW_GROUP_ID=9001
2019-03-11 13:36:37 stdout + NEW_USER_ID=9001
2019-03-11 13:36:37 stdout + rm -f /openhab/userdata/tmp/instances/instance.properties
2019-03-11 13:36:37 stdout + rm -f /openhab/runtime/instances/instance.properties
2019-03-11 13:36:37 stdout + ‘[’ limited = unlimited ‘]’
2019-03-11 13:36:37 stdout
2019-03-11 13:36:37 stdout + IFS=’
2019-03-11 13:36:37 stdout + set -euo pipefail
2019-03-11 13:36:37 stdout + interactive=true
2019-03-11 13:36:37 stdout ++ echo true
2019-03-11 13:36:37 stdout ++ test -t 0

start.sh

docker run
–name openhab
–net=host
-v /etc/localtime:/etc/localtime:ro
-v /etc/timezone:/etc/timezone:ro
-v /volume1/docker/openhab:/openhab
-d
-e USER_ID=9001
-e GROUP_ID=9001
–restart=always
openhab/openhab:2.4.0-amd64-alpine

bump up

gets this far then locks up.

^C[08:39:26] openhabian@openhab:~$ sudo docker run openhab/openhab
[sudo] password for openhabian:
++ test -t 0
++ echo false

  • interactive=false
  • set -euo pipefail
  • IFS=’
  • ‘[’ limited = unlimited ‘]’
  • rm -f /openhab/runtime/instances/instance.properties
  • rm -f /openhab/userdata/tmp/instances/instance.properties
  • NEW_USER_ID=9001
  • NEW_GROUP_ID=9001
  • echo ‘Starting with openhab user id: 9001 and group id: 9001’
    Starting with openhab user id: 9001 and group id: 9001
  • id -u openhab
    ++ getent group 9001
    Create group openhab with id 9001
  • ‘[’ -z ‘’ ‘]’
  • echo ‘Create group openhab with id 9001’
  • groupadd -g 9001 openhab
    Create user openhab with id 9001
  • echo ‘Create user openhab with id 9001’
  • adduser -u 9001 --disabled-password --gecos ‘’ --home /openhab --gid 9001 openhab
    Warning: The home dir /openhab you specified already exists.
    Adding user openhab' ... Adding new useropenhab’ (9001) with group openhab' ... adduser: Warning: The home directory/openhab’ does not belong to the user you are currently creating.
    The home directory /openhab' already exists. Not copying from/etc/skel’.
  • groupadd -g 14 uucp2
  • groupadd -g 16 dialout2
  • groupadd -g 18 dialout3
  • groupadd -g 32 uucp3
  • groupadd -g 997 gpio
  • adduser openhab dialout
    Adding user openhab' to groupdialout’ …
    Adding user openhab to group dialout
    Done.
  • adduser openhab uucp
    Adding user openhab' to groupuucp’ …
    Adding user openhab to group uucp
    Done.
  • adduser openhab uucp2
    Adding user openhab' to groupuucp2’ …
    Adding user openhab to group uucp2
    Done.
  • adduser openhab dialout2
    Adding user openhab' to groupdialout2’ …
    Adding user openhab to group dialout2
    Done.
  • adduser openhab dialout3
    Adding user openhab' to groupdialout3’ …
    Adding user openhab to group dialout3
    Done.
  • adduser openhab uucp3
    Adding user openhab' to groupuucp3’ …
    Adding user openhab to group uucp3
    Done.
  • adduser openhab gpio
    Adding user openhab' to groupgpio’ …
    Adding user openhab to group gpio
    Done.
  • case ${OPENHAB_VERSION} in
  • initialize_volume /openhab/conf /openhab/dist/conf
  • volume=/openhab/conf
  • source=/openhab/dist/conf
    ++ ls -A /openhab/conf
  • ‘[’ -z ‘html
    icons
    items
    persistence
    rules
    scripts
    services
    sitemaps
    sounds
    things
    transform’ ‘]’
  • initialize_volume /openhab/userdata /openhab/dist/userdata
  • volume=/openhab/userdata
  • source=/openhab/dist/userdata
    ++ ls -A /openhab/userdata
  • ‘[’ -z ‘etc
    logs
    tmp’ ‘]’
    ++ cmp /openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties
  • ‘[’ ‘!’ -z ‘]’
  • chown -R openhab:openhab /openhab
  • sync
  • ‘[’ -d /etc/cont-init.d ‘]’
  • sync
  • ‘[’ false == false ‘]’
    ++ IFS=’ ’
    ++ echo gosu openhab tini -s ./start.sh
  • ‘[’ ‘gosu openhab tini -s ./start.sh’ == ‘gosu openhab tini -s ./start.sh’ ‘]’
  • command=($@ server)
  • exec gosu openhab tini -s ./start.sh server
    Launching the openHAB runtime…

Please don’t paste code or logs without code tags.

What has been the solution?
I am facing a very similar error on a Synology DiskStation. Mine says that it cannot find start.sh (no such file or directory).
It does not make sense to me to include the docker command in start.sh because i think that the synology docker package runs this before the error occurrs. Or am I missing something?

Okay in my case the solution was to not create a mount point for /openhab but for /openhab/conf, /openhab/addons and /openhab/userdata separately.