Synology DiskStation

You can download and install the SPK. But the update of the ueserdata files does not work yet. Please use here a manual update.

What directories should I backup and restore for upgrading to 2.2? Can I restore files from both conf and userdata?

I attempted to use the linux backup scripts https://github.com/openhab/openhab-distro/blob/master/distributions/openhab/src/main/resources/bin/backup as my template for my backup scripts. But after restoring both conf and userdata, openHAB would not run. I removed openhab 2.2.0.010 and reinstalled it without restoring any files. They seemed to be in place. Now it runs, but I don’t get any log files. The file length is 0.

I also found that the directory name has changed to openHAB and the username has changed to openhab.

Christian has done a great job with 2.2 for the Synology! As Neil said, now that conf and userdata are in /volume1/public/openHAB, the user data doesn’t get wiped with new installs. openHAB 2.2 works well for me.

OK, there is work yet for the maintainers. My install will not log, but that doesn’t matter so much because it works. Permissions for conf and userdata don’t allow any users which can actually login to view files. The UID for user openhab increments on each install which is annoying, but the only problem it might cause is ownership will need to be changed if a file is restored from backup.

For Unix folks like me who ssh in as admin and use vi to make changes, the fixes are trivial:
sudo chown openhab.users /volume1/public/openHAB
sudo chmod -R 770 /volume1/public/openHAB/conf
sudo chmod -R 770 /volume1/public/openHAB/userdata

Note that addons is already full permissions for any users plus ACL permissions that I don’t quite understand. The synoacltool command will show full confusing details.
ls -ld /volume1/public/openHAB/addons
drwxrwxrwx+ 2 openhab users 4096 Jan 2 21:45 /volume1/public/openHAB/addons

I just installed the newly released 2.3.0.001-SNAPSHOT. It seems to work, but has some of the same issues I’ve seen in the 2.2.0.010 version.

The improvement I see is that all 3 directories in public/openHAB have the same permissions, I can access all files from Windows file explorer.

The issues I still are logging still does not work and addons,conf,and userdata directory permissions do not allow access.
ls -al /volume1/public/openHAB/userdata/logs/openhab.log
ls: cannot access /volume1/public/openHAB/userdata/logs/openhab.log: Permission denied
sudo ls -al /volume1/public/openHAB/userdata/logs
-rw-r–r-- 1 openhab users 0 Jan 21 21:21 openhab.log

ls -al /volume1/public/openHAB
drwxrwxrwx+ 5 1054 users 4096 Jan 17 15:09 .
drwxrwxrwx+ 4 root root 4096 Jan 2 21:44 …
drwx------+ 2 openhab users 4096 Jan 21 21:21 addons
drwx------+ 13 openhab users 4096 Jan 2 20:48 conf
drwx------+ 11 openhab users 4096 Jan 2 21:56 userdata`

N.B. My previous suggestion to use chmod is problematic because it removes ACL’s. It’s a short term answer to users who want to access files via login such as ssh. chmod will allow user access, but it will remove ACL permissions. When an ACL is set for a directory, the ls command will indicate an ACL is set by showing a + following the permissions. ls -e with -l will show syno-acl permission details for any directory. root permission or sudo is needed to see the same details with synoacltool -get.

What can we do here?

I’ve tried installing the openHAB 2.2.0.10 Version on a Synology DS118, and spent countless hours trying to figure out why the Box can’t communicate with the attached usb z-way stick. It says that the /dev/ttyACM0 port can not be accessed even though I’ve literrally have tried every trick I’ve Googled my way to. What seems a little funny is that I’ve successfully installed the same openHAB version on the “Bigbrother” DS218+, and a Domoticz installation on the DS118 box has no problem accessing the stick.

A user indicated on this thread (OH2 on Synology with USB stick - ACM0 not found) that “The DS118 has a Realtek RTD1296 processor whereas the DS218+ an Intel Celeron J3355. So perhaps some native libraries shipped with openHAB don’t support that architecture?”

Does anyone know if this might actually be the case?

Christian - I suggest 2 things to do:

Suggest some tool or procedure to diagnose why the log is not written. The permissions are adequate, but my Java knowledge is minimal. Nothing is obvious and I don’t know what to look for.

Change the ACL mask to provide permissions for user group access and probably even other. I had hoped to provide such detail, but my personal live got in the way. I still intend to do more testing by early February. In the mean time, any user who wants access to work can chmod the directories and have it work. I assume the original code is using ACL permissions for a good reason. I think the ACL mask just need a little modification.

I fixed logging today on my system. The root cause appears to be the change in Karaf versions at build #1009. See Karaf Upgrade for details.

So my ‘fix’ was to remove /volume1/public/openHAB/userdata/etc/org.ops4j.pax.logging.cfg and replace it with the version from https://openhab.ci.cloudbees.com/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab/target/openhab-2.3.0-SNAPSHOT.zip

old: -rwxrwxrwx 1 openhab users 2404 Jan 2 21:56 org.ops4j.pax.logging.cfg
new: -rw-r–r-- 1 openhab users 5756 Feb 5 15:21 org.ops4j.pax.logging.cfg

Note that the new file is much larger. I may change permissions later, but at least it’s logging. A lot of the log entries are nonsense, so it appears some customization is missing. For example:
2018-02-05 16:00:28.047 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-ui-homebuilder': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-package-standard; type=karaf.feature; version="[2.2.0,2.2.0]"; filter:="(&(osgi.identity=openhab-package-standard)(type=karaf.feature)(version>=2.2.0)(version<=2.2.0))"

The open question is why the install process does not upgrade configuration files that need to change when previous versions exist?

After I finally had the 2.3 snapshot version logging, I went ahead to upgrade to DSM 6.1.5-15254. This new version of DSM includes new file permission by user which I expect to be picked up by ACLs.

After the DSM update, openHAB would not start. So I decided to reinstall the production version 2.2.0.010. Now everything seems wonderful! Logging works and no longer has bogus error messages.

So if your Synology openHAB won’t log, the process seems to be:
Uninstall the openHAB package
Update the Karaf customization file: org.ops4j.pax.logging.cfg
Reinstall your desired level of openHAB - 2.2.0.010 works for me

I still want to dig into directory permissions to see what recommendations I can make.

Hi @cniweb, openHAB 2.1.0.003-SNAPSHOT is installed on my Synology NAS (DS216j with DSM 6.1.5-15254 Update 1). Is there a solution for updating openHAB via the DSM package center with the automatic restore of all userdata with 2.3.0.001-SNAPSHOT yet?
Thank you and best regards
Fabian

I have installed openHab on my Synology Diskstation DS713+. Everything’s fine.
Now I want to activate extended logging.
How do I get access to openHab as described here?

Because I want to set these 3 lines:
log:set TRACE org.openhab.io.caldav
log:set TRACE org.openhab.binding.caldav-command
log:set TRACE org.openhab.binding.caldav-personal

Just saw your post here. I had the same problem on a DS 212+, which has a MARVELL Kirkwood 88F6282 CPU (ARMv5). OpenHAB simply crashed when accessing my USB Z-WAVE stick because some Java library, which was obviously needed to access the native driver of the serial port, was not available for this CPU type.
Since then I’ve upgraded to a 718+ which has an INTEL Celeron J3455 and there are no problems at all.

I got no /var/packages directory. Any idea where to copy untared jdk1.8.0.xxx to?

I answer my question: I simply created the directories.

UPDATE 1: I had to start java installation in this directory otherwise it would not work: /var/packages/Java8/target/j2sdk-image/ → from here apt-get install oracle-java8-installer works.

hi Christian, will there be a synology package for the release of v2.3?

It would be great if there was. Thanks in advance.

Hi All,

I packaged a new release for OH 2.3.0:

Chris

2 Likes

thanks Christian, I’ll give it go in a few days when I have some time.

hi Christian, I’ve tried installing/running, and it says “failed to start package”. I’ve noticed that an openhab user isn’t created, too.

Seeing the issues on Github regarding the OH 2.3.0 release it seems it is not advisable yet to install it to replace a previous version?
I am reluctant to try because I fear I’ll loose my config with all Z-Wave things/items and such…

Hi,
I have the same problem with OH 2.3.0 that it will not start.
All relevant directories are empty.

Using
a DS214play
with DSM 6.1.7-15284
java version “1.8.0_172”
Java™ SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot™ Client VM (build 25.172-b11, mixed mode)