Make it work with Cockpit (2)

New version of #1