cmd/snap: add check switch for snap debug state
Add a new flag to snap debug state that helps investigate if a given state
contains task dependency cycles.
On a particularly problematic dump it looks like this:
Detected task dependency cycle involving tasks:
Lanes ID Status Spawn Ready Kind Summary After Before
2 341 Do 27 days ago, at 09:22 CET 0001-01-01 prerequisites Ensure prerequisites for "pc-kernel" are available [322,323,324,...] [342,359,360]
2 342 Do 27 days ago, at 09:22 CET 0001-01-01 download-snap Download snap "pc-kernel" (932) from channel "20/stable" [341,322,323,...] [343,359,360]
2 343 Do 27 days ago, at 09:22 CET 0001-01-01 validate-snap Fetch and check assertions for snap "pc-kernel" (932) [342,322,323,...] [344,359,360]
2 344 Do 27 days ago, at 09:22 CET 0001-01-01 mount-snap Mount snap "pc-kernel" (932) [343,322,323,...] [345,359,360]
2 345 Do 27 days ago, at 09:22 CET 0001-01-01 run-hook Run pre-refresh hook of "pc-kernel" snap if present [344,322,323,...] [346,359,360]
2 346 Do 27 days ago, at 09:22 CET 0001-01-01 stop-snap-services Stop snap "pc-kernel" services [345,322,323,...] [347,359,360]
2 347 Do 27 days ago, at 09:22 CET 0001-01-01 remove-aliases Remove aliases for snap "pc-kernel" [346,322,323,...] [348,359,360]
...
2 360 Do 27 days ago, at 09:22 CET 0001-01-01 run-hook Run health check of "pc-kernel" snap [341,342,343,...] []
3,2 371 Do 27 days ago, at 09:22 CET 0001-01-01 link-snap Make snap "core20" (1376) available to the system [370,351] [372,378,379,...]
3,2 372 Do 27 days ago, at 09:22 CET 0001-01-01 auto-connect Automatically connect eligible plugs and slots of snap "core20" [371,352] [373,378,379,...]
3 373 Do 27 days ago, at 09:22 CET 0001-01-01 set-auto-aliases Set automatic aliases for snap "core20" [372,353] [374,378,379,...]
3 374 Do 27 days ago, at 09:22 CET 0001-01-01 setup-aliases Setup snap "core20" aliases [373] [375,378,379,...]
3 375 Do 27 days ago, at 09:22 CET 0001-01-01 run-hook Run post-refresh hook of "core20" snap if present [374] [376,378,379,...]
3 376 Do 27 days ago, at 09:22 CET 0001-01-01 start-snap-services Start snap "core20" (1376) services [375] [377,378,379,...]
3 377 Do 27 days ago, at 09:22 CET 0001-01-01 cleanup Clean up "core20" (1376) install [376] [378,379,380,...]
3 378 Do 27 days ago, at 09:22 CET 0001-01-01 run-hook Run health check of "core20" snap [361,362,363,...] [379,380,381,...]
...
Signed-off-by: Maciej Borzecki <email address hidden>