openhab / openhab-qnap-qpkg

openHAB Packages for QNAP NAS systems
Eclipse Public License 2.0
77 stars 21 forks source link

Update openHAB.sh for more reliable restarts. #50

Open cutlasjgh opened 6 years ago

cutlasjgh commented 6 years ago

Changes to make openHAB restart more reliably. I found under Qnap 4.3.4 there were 2 reasons that openHAB 2.0.0 won't start. First reason would show up in logs as: "Java not found! Please read the documentation about details." Second reason was issues with instance.properties file was both looked for in wrong path, and also not being removed. 3 changes were made:

  1. The old -d check for JAVA_HOME doesn't always work if directory is a link, use -e instead.
  2. Actual path to instance.properties file changed it seems, karaf was dropped from pathname.
  3. Removes instance.properties file after verifying process is not running.

Attempts to fix #31 #46 #47

thopiekar commented 5 years ago

Looks good to me. Additionally, it sounds to me like you are experienced. Hope you don't mind that I'm not merging your PR, because there is no real maintainer at the moment. If you are interested in maintaining this project, just let me know!

Toffi32 commented 5 years ago

After some path are changed, this has to be adapted.

rm ${QPKG_DISTRIBUTION}/userdata/tmp/instances/instance.properties