Removing Zwave Lock File

Hey All,
I’ve got a docker running OpenHab, it’s all working fine apart from if I restart, then I get a lock file error. I’ve tried removing /var/lock/LCK…ttyUSB0 on startup, but that doesn’t seem to work.

RXTX fhs_lock() Error: opening lock file: /var/lock/LCK..ttyUSB0: File exists.
testRead() Lock file failed
2015-10-15 22:12:34.776 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyUSB0 does not exist

Any ideas on how to make sure it’s either removed on shutdown or startup?
Thanks
Christian

I’ve been meaning to set up a symlink for the USB Dongle based on the docs, so I’ll have a go at that to see if it get’s around the problem.

I think it means you have or had a conflict in users somewhere. Which user starts the docker ? which user starts OH inside the docker container ?

OH “automagically” removes the lock (if it exists) and creates a new one during the OH startup process, so there’s a privilege issue in here. If (inside your docker container), you sudo remove the lock file, exit the docker, then re-initialize, does the problem recur ? if so, then definitely privilege issue/conflict as in my question above.

Ok thanks, I’l have a look when I get home.

Looks like the docker isn’t giving OpenHab enough time to shutdown properly, so the lock file doesn’t get removed. rm’ing it in a startup script works fine for the minute.

*** Shutting down runit daemon (PID 12)...
*** Killing all processes...
2015-10-17 14:22:26.321 [INFO ] [penhab.io.rest.RESTApplication] - Stopped REST API
*** Not all processes have exited in time. Forcing them to exit.

This is more of a docker setup issue…
Thanks
Christian

I know this is an old thread, but I just ran across this issue. @christianjwaite, did you ever come up with a resolution? Could you share it if you did?