Amazon Dash, cannot use due permission issue

Hi all,
I installed Amazon Dash Binging e followed how to to configure at this link:
http://docs.openhab.org/addons/bindings/amazondashbutton/readme.html

I have Openhab installed from apt repository.
After I run setcap command, to give specific right to java for capturing ARP packet, my openhab service, do not start anymore, only way to start openhab is from console.
If i remove setcap rights to java, openhab start as service again.
When issu eis in place i con this when run systemctl status openhab2:

root@OpenHab2:/usr/share/openhab2# systemctl enable openhab2
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
Executing /usr/sbin/update-rc.d openhab2 enable
root@OpenHab2:/usr/share/openhab2# systemctl start openhab2
root@OpenHab2:/usr/share/openhab2# systemctl status openhab2
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: failed (Result: start-limit) since Sat 2016-11-26 01:18:41 CET; 873ms ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 19602 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=127)
  Process: 19530 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=127)
 Main PID: 19530 (code=exited, status=127)

Nov 26 01:18:40 OpenHab2 systemd[1]: openhab2.service: control process exited, code=exited status=127
Nov 26 01:18:40 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.
Nov 26 01:18:41 OpenHab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 26 01:18:41 OpenHab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 26 01:18:41 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 01:18:41 OpenHab2 systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Nov 26 01:18:41 OpenHab2 systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Nov 26 01:18:41 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.

and this in syslog:

Nov 26 03:11:53 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 03:11:53 OpenHab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Nov 26 03:11:53 OpenHab2 start.sh[28957]: Launching the openHAB runtime...
Nov 26 03:11:53 OpenHab2 start.sh[28957]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:53 OpenHab2 start.sh[28957]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:53 OpenHab2 start.sh[28957]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:53 OpenHab2 start.sh[28957]: /usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:53 OpenHab2 systemd[1]: openhab2.service: main process exited, code=exited, status=127/n/a
Nov 26 03:11:53 OpenHab2 stop[29028]: /usr/share/openhab2/runtime/karaf/bin/stop: 180: [: Illegal number:
Nov 26 03:11:53 OpenHab2 stop[29028]: stop: Ignoring predefined value for KARAF_HOME
Nov 26 03:11:53 OpenHab2 stop[29028]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:53 OpenHab2 stop[29028]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:53 OpenHab2 stop[29028]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:53 OpenHab2 stop[29028]: /opt/jdk/jdk1.8.0_102/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:53 OpenHab2 systemd[1]: openhab2.service: control process exited, code=exited status=127
Nov 26 03:11:53 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 26 03:11:54 OpenHab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Nov 26 03:11:54 OpenHab2 start.sh[29115]: Launching the openHAB runtime...
Nov 26 03:11:54 OpenHab2 start.sh[29115]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29115]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29115]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29115]: /usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: main process exited, code=exited, status=127/n/a
Nov 26 03:11:54 OpenHab2 stop[29186]: /usr/share/openhab2/runtime/karaf/bin/stop: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29186]: stop: Ignoring predefined value for KARAF_HOME
Nov 26 03:11:54 OpenHab2 stop[29186]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29186]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29186]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29186]: /opt/jdk/jdk1.8.0_102/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: control process exited, code=exited status=127
Nov 26 03:11:54 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 26 03:11:54 OpenHab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 start.sh[29272]: Launching the openHAB runtime...
Nov 26 03:11:54 OpenHab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Nov 26 03:11:54 OpenHab2 start.sh[29272]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29272]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29272]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29272]: /usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: main process exited, code=exited, status=127/n/a
Nov 26 03:11:54 OpenHab2 stop[29343]: /usr/share/openhab2/runtime/karaf/bin/stop: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29343]: stop: Ignoring predefined value for KARAF_HOME
Nov 26 03:11:54 OpenHab2 stop[29343]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29343]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29343]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: control process exited, code=exited status=127
Nov 26 03:11:54 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.
Nov 26 03:11:54 OpenHab2 stop[29343]: /opt/jdk/jdk1.8.0_102/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 26 03:11:54 OpenHab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Nov 26 03:11:54 OpenHab2 start.sh[29429]: Launching the openHAB runtime...
Nov 26 03:11:54 OpenHab2 start.sh[29429]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29429]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29429]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29429]: /usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: main process exited, code=exited, status=127/n/a
Nov 26 03:11:54 OpenHab2 stop[29501]: /usr/share/openhab2/runtime/karaf/bin/stop: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29501]: stop: Ignoring predefined value for KARAF_HOME
Nov 26 03:11:54 OpenHab2 stop[29501]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29501]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29501]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29501]: /opt/jdk/jdk1.8.0_102/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: control process exited, code=exited status=127
Nov 26 03:11:54 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 26 03:11:54 OpenHab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 03:11:54 OpenHab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Nov 26 03:11:54 OpenHab2 start.sh[29587]: Launching the openHAB runtime...
Nov 26 03:11:54 OpenHab2 start.sh[29587]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29587]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29587]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 start.sh[29587]: /usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: main process exited, code=exited, status=127/n/a
Nov 26 03:11:54 OpenHab2 stop[29658]: /usr/share/openhab2/runtime/karaf/bin/stop: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29658]: stop: Ignoring predefined value for KARAF_HOME
Nov 26 03:11:54 OpenHab2 stop[29658]: /usr/share/openhab2/runtime/karaf/bin/karaf: 180: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29658]: /usr/share/openhab2/runtime/karaf/bin/karaf: 239: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29658]: /usr/share/openhab2/runtime/karaf/bin/karaf: 284: [: Illegal number:
Nov 26 03:11:54 OpenHab2 stop[29658]: /opt/jdk/jdk1.8.0_102/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
Nov 26 03:11:54 OpenHab2 systemd[1]: openhab2.service: control process exited, code=exited status=127
Nov 26 03:11:54 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.
Nov 26 03:11:55 OpenHab2 systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 26 03:11:55 OpenHab2 systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 26 03:11:55 OpenHab2 systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 26 03:11:55 OpenHab2 systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Nov 26 03:11:55 OpenHab2 systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Nov 26 03:11:55 OpenHab2 systemd[1]: Unit openhab2.service entered failed state.

any help would be appreciated.

Marco

Hi,
for who will fall in my issue, I find the solution here:

The solution is simply link the library libjli.so, to a /usr/lib/ with this command:

ln -s /opt/jdk/jdk1.8.0_102/lib/amd64/jli/libjli.so /usr/lib/

Replace java path and file location according with your enviroment.

Marco

1 Like

That helps with this library but after that I’d got the same problem with libjava.so.
I think that something wrong and had to be fixed not by hundreds of ln.

The proble occered after I execute inside the container:

setcap cap_net_raw,cap_net_admin=eip $(realpath /usr/bin/java)

Without that everything works ok… but I need that additional capabilities for Amazon Dash Button support.

And I cannot use docker command line options for that because I want to run Openhab docker on Synology and they just hide this options and you cannot use them.

Looks like this is about https://bugs.java.com/view_bug.do?bug_id=7157699