openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

'systemctl stop openhab' takes a long time and throws an exception

Open ronisaacson opened this issue 4 years ago • 3 comments

With openhab 3.0.0 on Fedora, installed from the yum repo and managed by systemd... every time I try and stop OH using systemctl stop openhab it logs this in the systemd journal:

Dec 17 00:41:28 xxx systemd[1]: Stopping openHAB - empowering the smart home...
Dec 17 00:41:33 xxx karaf[1204679]: org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.12.100.v20180210-1608"; singleton:="true" [id=0] STOPPED [STOPPED]
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.asyncStop(EquinoxBundle.java:156)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.stop(EquinoxBundle.java:262)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.stop(EquinoxBundle.java:267)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.launch.Equinox.stop(Equinox.java:123)
Dec 17 00:41:33 xxx karaf[1204679]:         at org.apache.karaf.main.Main$2.run(Main.java:354)
Dec 17 00:41:33 xxx karaf[1204679]: Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
Dec 17 00:41:33 xxx karaf[1204679]:         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
Dec 17 00:41:33 xxx karaf[1204679]:         ... 5 more
Dec 17 00:41:43 xxx systemd[1]: openhab.service: Succeeded.

ronisaacson avatar Jan 05 '21 04:01 ronisaacson

One more thing: I found the (empty) file /var/lib/openhab/cache/org.eclipse.osgi/.manager/.fileTableLock, stopped OH and removed it. But it came right back upon restart. Also tried clearing the entire /var/lib/openhab/cache directory and letting OH rebuild it on the next restart, but same thing again.

ronisaacson avatar Jan 06 '21 18:01 ronisaacson

Is this still the case with openHAB 3.2?

J-N-K avatar May 06 '22 20:05 J-N-K

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 05 '22 21:07 stale[bot]