snap daemons ignoring blocked state

Bug #1940442 reported by Joseph Borg
6
This bug affects 1 person
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"
```

Revision history for this message
Joseph Borg (joeborg) wrote :

This is using snapd 2.51.3

Revision history for this message
Samuele Pedroni (pedronis) wrote :

snapctl set-health blocked "This should stop the snap"

that is never been the case. So the behavior you were observing and that changed is related to something else.

snapd doesn't take into account set-health in any way for its own operations.

Blocked is more meant for a snap that for example is waiting on an interface to be connected, again snapd itself doesn't prevent anything from happening at that point

Changed in snapd:
importance: Undecided → Critical
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.