Startup delay due to lock file

I’ve been having the problem that to start OH2 on my Pi3 takes VERY long (>30 mins until zwave start initialising).
I am currently using 2.2 snapshot 1008 on a Jessie Raspian using APT, but the problem has been there for a long long time and throughout various OH versions.
java didn’t seem to do anything really at times. Now stracing the java process, I noticed it’s accessing the lock file /var/lib/openhab2/tmp/lock over and over, and I also noticed the file was three days old although I had been restarting OH several times in the meantime.
After deleting the tmp dir including the lockfile (and cache dir), startup was MUCH faster. I tried cache deletion earlier, but only that did not make a notable difference.

I had the Pi crash or did kill -9 java at times, that’s why the lock file was there.
The point, though, is: why didn’t it get deleted on startup?

Is anyone else experiencing this kind of startup delay ? If so, see if to delete the lock file makes a difference for you.

30 mins until you see the initial Z-Wave startup messages like:

09:21:42.246 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyACM0'
09:21:42.369 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized
09:21:42.374 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey
09:21:42.385 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller
09:21:42.385 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.
09:21:45.543 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 1: Node found
09:21:45.543 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 2: Node found
09:21:45.543 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 3: Node found
09:21:45.543 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 4: Node found
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 6: Node found
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 8: Node found
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 9: Node found
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller using Controller API
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller is Primary Controller
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - ------------Number of Nodes Found Registered to ZWave Controller------------
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - # Nodes = 7
09:21:45.544 [INFO ] [age.SerialApiGetInitDataMessageClass] - ----------------------------------------------------------------------------

or 30 mins till your Z-Wave nodes/things become online?

It should have been deleted during the apt-get upgrade (which cleans tmp & cache)

no, 30 mins until zwave binding starts.

I see java at 100% + CPU during this and there’s occasional progress log messages, but it’s way too slow and I don’t really know what it’s doing. Seems like a single full CPU core is busy. Any hint what debugging setting to apply for that ?

The point, though, is: why didn’t it get deleted on startup?

ok, but what about if the java process or whole system crashes ? Wouldn’t it need to be deleted on every startup ?