The snapd-control interface

The snapd-control interface enables snap management, such as snap installation, removal and refresh-control by communicating with the snapd daemon.

Due to its ability to permit the installation any snap at potentially any confinement level, snapd-control is primarily intended to be used by brand store owners as they will typically already have full access to their devices.

Consequently, consumers of this interface require approval for distribution via the Snap Store, and this approval is only likely to be given under strict and specific circumstances.

Interface documentation: See Interface management and Supported interfaces for further details on how interfaces are used.


Developer details

Auto-connect: no
Super-privileged: yes

Attributes :

  • refresh-schedule (plug): can be set to managed to signal an intention to permit only manual refreshes for the snap:

    plugs:
        snapd:
            interface: snapd-control
            refresh-schedule: managed
    

    Permitting only manual refreshes is a 3 stage process with the above being the first stage. The second stage is to connect the interface, effectively granting permission for refresh management while the third is to set the following core system setting:

    sudo snap set core refresh.timer=managed 
    

    The last step activates the manual-only refresh option, skipping upcoming refresh attempts. These values are rechecked and reconfirmed before every future refresh attempt. If any of the steps stop being true, the snap refresh proceeds.

Code examples

The test code can be found in the snapd repository: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/snapd_control.go

The source code for the interface is in the snapd repository: https://github.com/snapcore/snapd/blob/master/interfaces/builtin/snapd_control_test.go

Hi @degville,

It seems like sudo snap set core refresh.schedule=managed was deprecated and should only be used with versions of snapd older than 2.31 as mentioned here => https://snapcraft.io/docs/keeping-snaps-up-to-date#heading--controlling-updates

It needs to be replaced with snap set system refresh.timer="managed"

Thanks, Bugra

With snapd-2.5, you now have “snap refresh --hold” to put an indefinite hold on refreshes. Not sure where that should be covered.