snap daemons ignoring blocked state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Won't Fix
|
Critical
|
Unassigned |
Bug Description
I initially saw this whilst working in MicroK8s strict, but have reproduced this in a simple snap. It seems that, if the snap went into blocked state during the install hook, daemons in the snap would not start (to me, this is expected and desired behaviour) and this is experience we used to have in the MicroK8s strict snap.
Since then, it seems that snapd ignores the blocked state and continues to start the daemons. A quick example:
```snapcraft.yaml
name: my-snap-name
base: core18
version: "0.1"
summary: Single-line elevator pitch for your amazing snap
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel
confinement: strict
apps:
test:
command: /bin/sleep 99999
daemon: simple
parts:
test:
plugin: nil
```
```hooks/install
#!/bin/bash
snapctl set-health blocked "This should stop the snap"
```
Changed in snapd: | |
importance: | Undecided → Critical |
status: | New → Won't Fix |
This is using snapd 2.51.3