How to start karaf on synology docker

I have OH2.5 installed on my Synology.
I installed OH3 in a docker to learn the system
I found somewhere the following command to start karaf.
docker exec -it OpenHAB3 /openhab/runtime/bin/client
The strange thing is that I don’t get a error message but after entering the password it displays openHAB 2.5.
What is wrong / who can help with this?

Assuming that “OpenHAB3” is literally the name of your container (case matters) that command is correct. It works for me at least but I’m not trying to run on a Synology. A given the number of threads of people having problems running on Synology I’m always surprised when people try.

You mean you see this?

                           _   _     _     ____  
   ___   ___   ___   ___  | | | |   / \   | __ ) 
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ 
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ 
       |_|       3.1.0-SNAPSHOT - Build #2220

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

openhab>                                              

If so then congratulations, it’s working.

No I see version 2.5
image

OK, so your problem isn’t that you cant access the Karaf console. The problem is you are not in fact running OH 3, or when you upgraded the configs didn’t get updated and the files in userdata/etc are still all 2.5 based. Beyond that I can’t offer anything.

No as mentioned I’m running native OH 2.5 and in a docker OH3. I didn’t do any configuration in OH3 yet but the browsers shows really the OH3 GUI. (configured port 9080. for OH2.5 I use the default 8080)
It looks like the command is starting karaf from the native OH2.5. I checked the bundle:list with the karaf command I use for OH2.5 ssh -p 8101 openhab@localhost and 100% the same.

How are you persisting the userdata and conf folders? If useradata/etc is filled with OH 2.5 configs then it’s going to falsely show that you are running 2.5. It’s one of those files where the version that is shown when you log into the karaf console.

It can’t possibly be the natively installed karaf with that command. docker puts you interacting with Docker containers. exec -it tells it to execute the command interactives. OpenHAB3 tells it the name of the container to execute the command on. /openhab/runtime/bin/client provides the path to the command to execute inside the container. I think you will see that /openhab/runtime/bin/client does not exist anywhere on your Synology system. It only exists inside the container.

This is the file structure
image
The mapping
image
And nothing configured so nothing in the conf folders except the created empty dirs during installation.
I don’t understand what is happening.

At this point all I can say is all I see on the forum are people having problems with trying to install openHAB on Synology. I don’t use nor own a Synology and can’t help any more than what I’m mentions so far. It looks a whole lot like the userdata that is mounted into the container is a 2.5 useradata, not an OH 3 userdata.

I have openHAB in a Synology Docker for years and not any issue with it. e.g.switching from one SNAPSHOT to another is a matter of minutes, switching back as well :slight_smile: .

Three things here to look at:

  1. have you altered the ports for the openHAB instances? e.g. for openHAB2.5 the port might be 8080, you should set the port for openHAB 3 to e.g. 8085. You can do this when you set up the container. If both are on the same port, it wont work.

  2. why do you want to start the openHAB docker with a karaf command? Once you created the container, you can start the container in the Synology environment. Then go into the container and check the log if it started… no need for a karaf command.

  3. make sure that the file/folder have the correct permission for openHAB to access.

Last but not least some bindings don’t like to be connected to two instances at the same time. I had trouble with my Homematic binding.

Is there nobody who runs karaf in a docker on a Synology system who can explain how to run it?

I believe you either have a permission problem with the files in OH3 or you are not running the docker in the same network

image

Review the settings and permissions. Start the docker from Synology. No need to start the docker with a console command:

go to the Protokoll to see if it started and if the oh directory permissions were correctly granted.

go to terminal. this is the in my oppinion the karaf environment:

Hi Jan,
Thanks for this info.
Yes the terminal screen is karaf.
It is a bit slow but working.
Now I start debugging because the new Shelly binding isn’t running yet at least it is not shown in the GUI.

Assuming you manual installed the binding: If you placed the jar in the addon folder it will not show up in the UI overview with bindings.
In the overview when searching things it will show up though.

Thanks. I restarted the package from karaf and still didn’t see. Later I found it as you mentioned. Thanks anyhow.