Synology DiskStation

exactly, that is what I did.
But OH doens’t recognize the conf files. At least they aren’t shown in e.g. Paper UI.

Try to create the conf directory like: / volume1/public/openhab2/conf; not /volume1/public/conf. Then uninstall and reinstall the openhab package.

My Synology doesn’t shows the folder public as as subdir of volume1. should i create a folder named pulic/openhub2

Yes normally you should create a ‘public/openHAB2/conf’ directory under volume1 prior to installing OH2 if you are installing a package installation.

After trying to get openHAB running in docker on my DS1815+ I switched to this packages. Docker had some limitations, e.g. exec not usable. Hope that will work with this here. :slight_smile:

The installation worked as described but I have some additional questions/remarks. (maybe I can update the official Synology openHAB setup page afterwards?).

  • it’s not always possible to use the latest Java8 SE version because the package from PC-Loadletter is not up to date. And it happens that you download the wrong version. That should be mentioned. The PC-Loadletter package will show the needed version when started.
  • I struggled a lot with the config and logs folder at the beginning.
    ** I’m used to work with the shared folders and wanted to have my configuration there. One reason is that it is then accessible via web UI as well as a network share. Second reason is that HyperBackup can only access shared folders.
    ** I don’t wanted to have a public shared folder (I had the impression it will only work with a public folder)
    ** I wanted to have the config in another shared folder which is encrypted

So what I did after some research on this page (and others) is as someone suggested further up to create some symlinks. Here is what I did:

  • created a openHAB2 folder on my encrypted shared folder (appstorage) - it includes a conf and a logs folder
  • I copied the conf files from my local (windows) testsystem to this folder (you can also copy the generated folder from volume1/@appstore/openHAB2/conf)
  • I deleted the conf folder from volume1/@appstore/openHAB2/ and created a new symlink to my new conf folder destination (changed the owner too):
    sudo ln -s /volume1/appstorage/openHAB2/conf /volume1/@appstore/openHAB2/conf
    sudo chown -R openhab2:users /volume1/@appstore/openHAB2/conf
  • I deleted the logs folder from volume1/@appstore/openHAB2/userdata/ and created a symlink there too:
    sudo ln -s /volume1/appstorage/openHAB2/logs /volume1/@appstore/openHAB2/userdata/logs
    sudo chown -R openhab2:users /volume1/@appstore/openHAB2/userdata/logs

Currently everything starts and I can reach the openHAB instance on port 8080. My config is also available and the logs are created in my new log folder.
My question now is, if there is any drawback of this solution or does someone see a problem with that? I’m not a Linux expert so I’m not sure if I missed some important point.

Short update to my previous post. I’ve seen/realized that most of the configurable stuff done e.g. via paperUI is stored in userdata. Therefore I removed the link for the logs folder and added a symlink for the whole userdata and addons folder. I created a bash script for that:

#!/bin/bash
# remove standard folders
sudo rm -rf /volume1/@appstore/openHAB2/conf
sudo rm -rf /volume1/@appstore/openHAB2/userdata
sudo rm -rf /volume1/@appstore/openHAB2/addons

# create symlink to new folder destination
sudo ln -s /volume1/appstorage/openHAB2/conf /volume1/@appstore/openHAB2/conf
sudo ln -s /volume1/appstorage/openHAB2/userdata /volume1/@appstore/openHAB2/userdata
sudo ln -s /volume1/appstorage/openHAB2/addons /volume1/@appstore/openHAB2/addons

# set user/group for symlinks
sudo chown -R openhab2:users /volume1/@appstore/openHAB2/conf
sudo chown -R openhab2:users /volume1/@appstore/openHAB2/userdata
sudo chown -R openhab2:users /volume1/@appstore/openHAB2/addons

# make sure openhab2 user has r/w access to shared folder (appstorage)

It works as far as I’ve seen. Everything starts and files/folders are updated and changed. Only drawback is currently that I would like to move the logs, cache and tmp folder out of the userdata and just link them but I don’t know if HyperBackup would still back all the data which is linked anyway. Therefore I leave it as it is and just deselect this folders in HyperBackup (have to select newly created folders (e.g. from addons) in HyperBackup later).

Still the question is open if anyone sees a drawback in my way or has any other comment.

Erkan, you mentioned having problems with the Oracle Java installation. In my Synology DS213J (DSM 6.1.2-15132) I have OpenJDK java which I want to replace with Oracle java.

I’m following the instructions from here but getting errors in the Oracle java installation. I’m using the Debian chroot package. The error that I’m getting is:

/var/packages/debian-chroot/scripts/start-stop-status chroot
apt-get install oracle-java8-installer
...
Preparing to unpack .../oracle-java8-installer_8u131-1~webupd8~2_all.deb ...
readelf: Error: '/proc/self/exe': No such file
dpkg: error processing archive /var/cache/apt/archives/oracle-java8-installer_8u131-1~webupd8~2_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/oracle-java8-installer_8u131-1~webupd8~2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any one has an idea how to install Oracle java on Synology?
Thanks


UPDATE:
I installed Oracle java, using these instructions (section: Java (ARMv7 models, DSM 6.0 or later)). Now java shows the right version (I think, as it does not show OpenJDK anymore)
To make it accessible within the chroot, I added the following steps

  1. Download the Oracle java package (Linux ARM 32 Hard Float ABI, jdk-8u131-linux-arm32-vfp-hflt-demos.tar.gz) from here

  2. Copy the tar file into the chroot environment from outside chroot, as root

cp \
/tmp/jdk-8u131-linux-arm32-vfp-hflt.tar.gz \
/volume1/\@appstore/debian-chroot/var/chroottarget/tmp/
  1. Untar and copy the untarred directory
mkdir -p /tmp/tmp2
pushd /tmp/tmp2
tar -xzvf ../jdk-8u131-linux-arm32-vfp-hflt.tar.gz
cp -r  /tmp/tmp2/jdk1.8.0_131/* /var/packages/Java8/target/j2sdk-image/

  1. Set up paths
    export LD_LIBRARY_PATH=/var/packages/Java8/target/j2sdk-image/jre/lib/arm/jli

  2. Check java version after installation of Oracle java

root@DiskStation:/# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode)
1 Like

I suggest that the Synology install instructions page be updated regarding the Java prerequisite.

The current suggestion to use the PC-Loadletter Repo is problematic. That tool has not been updated since January so it will install an out-of-date version of Java missing Oracle security fixes. Even worse, it installs a version of Java that will not work on certain ARMv7 machines.

My suggestion is to document the Synology maintained Java 8 package available from the Package Center on the DiskStation. After the Java 8 package is installed, open it and select the Upgrade Java box. The package will guide the user to download and install the current Oracle Java SE package appropriate for the processor of the Synology unit.

A new release is available:
https://github.com/openhab/openhab-syno-spk/releases/download/2.1.0.008/openHAB-2.1.0.008-syno-noarch-0.001.spk
Try it, please.
I have no DSM 6.1 DiskStation, Sorry!

1 Like

I have the same (no folders, no package download during installation process and no openhab user). Have a DS1511 and DS1512+ same on both… :frowning: I use the orginal Java package “ejdk-8u121-linux-i586.tar” (no manual update). I have made “Volume1/public/openHAB/conf”, “Volume1/public/openHAB/addons”, “Volume1/public/openHAB2/conf”,“Volume1/public/openHAB2/addons”. Don’t know if the folder should be called openHAB og openHAB2?

I have created a new version:

1 Like

thanks for 2.2 snapshot 7, Christian - it’s installed and is running well on my DS214play with DSM6.

It’s already been said before in the thread, but why is the package not available in the SynoCommunity repo? When checking this we can see that Home Assistant is just there, but OpenHAB is not. It would make life a lot easier then hunting down packages…

Hi,
first of all thanks a lot for this package and the effort you’ve spent on it! I love it :slight_smile:

I’ve installed it, migrated my /conf files and basically all worked fine instantly.
The only cumbersome issue I face, is that the logs stay empty completely, displaying “No Data” in the Packet Center.
I’ve given the Openhab2:Users read/write access to /volume1/@appstore/openHAB2/userdata/logs$ but this didn’t have any effect.

I’m running
DSM 6.1.3-15152 Update 6 (this issue was present in Update 4 & 5 before) on a DS716+II with 2.2.0-007-SNAPSHOT installed on it.

May I please ask your support what to do to get the logs filled?

thanks in advance,
Kurt

hi Kurt,

I’m running the same snapshot and the logging is working OK. (that’s with DSM 6.1.3-15152 Update 6 on a DS214play).

I’ve just noticed you say “Openhab2:Users”, but on my system it’s ‘openhab2:users’. Might that be it?

Hi,

Thanks for your swift reply, but it’s actually owned by openhab2:users

I still get an empty logfile
18

does the log files exist at
/volume1/@appstore/openHAB2/userdata/logs/openhab.log …?

That’s where the package centre will be reading the log file from.

Hi,

the file itself is there, but it’s not being populated, having 0bytes in size.
that’s why I initially thought it’s just lacking r/w of the openhab2 user - but this seems not to be the root cause.

:-/

Kurt

that’s reached the limit of my knowledge then, sorry.

The only idea I can suggest is stopping OH, deleting the log file and then restarting OH.

Tried Installation on Diskstation 713+
Several SPK 2.1.0-008 and the 2.2.0 -007
Using newest dsm 6.1.3…

Before manual istallation it says: (translated from german)
Port undefined, which was configured for this packag will be used either by other service or is reserved…

I assume that there is a port configured with name "undefined"
Do I have to define the port anywhere? anyhow?
thx
Peter