While running 'service opennms shutdown', my system completely hung and was unable to restart. The web UI was inaccessible. I was able to trigger a thread dump with kill -3 and it looks like the deadlock is caused by RTC. One RTC DataManager thread is POSTing an RTC update to the web UI and appears to have hung, probably because the web UI was destroyed during shutdown.
The Rtcd.stop() method itself synchronizes on the DataManager class so it is unable to complete.
We should avoid this problem by removing the synchronization around the RTC POST inside DataManager. That way, the slow and I/O dependent POST operation will not interfere with methods that really should be synchronized (like startup and shutdown).
Or we could just delete RTC.