~snappy-dev/snapd/+git/snapd-pawel:validation-sets/fix-refresh-revert

Last commit made on 2022-05-27
Get this branch:
git clone -b validation-sets/fix-refresh-revert https://git.launchpad.net/~snappy-dev/snapd/+git/snapd-pawel

Branch merges

Branch information

Name:
validation-sets/fix-refresh-revert
Repository:
lp:~snappy-dev/snapd/+git/snapd-pawel

Recent commits

fdc9f32... by Paweł Stołowski

Report internal error if not all snaps with wrong revisions are among
refreshed snaps (and can be reverted).

5e7b9f4... by Paweł Stołowski

Make sure snap revert triggered by
maybeRestoreValidationSetsAndRevertSnaps() doesn't conflict with the
main change where check-rerefresh runs. Add more tests.

adf1d93... by Alberto Mardegan

interfaces/builtin: add README file (#11681)

* interfaces/builtin: add README file

At the moment, this document explains the format of the base
declaration, and should help interface developers to write the various
`allow-*` and `deny-*` rules about installation, connection and
auto-connection.

* i/b/README: fix content interface in example

* i/b/README: better document base- vs snap- declarations

Thanks Samuele for the suggestions.

* i/builtin/README.md: some edits hopefully clarifying some things

* i/b/README: Apply suggestions from code review

Thanks @degville! :-)

Co-authored-by: Graham Morrison <email address hidden>

* i/b/README: correct the logic of automatic connections

The original meaning was lost with the last edit.

Co-authored-by: Samuele Pedroni <email address hidden>
Co-authored-by: Graham Morrison <email address hidden>

84434d9... by Alberto Mardegan

Merge pull request #11786 from mardy/mount-support-cleanups

cmd/snap-confine: mount support cleanups

ace7d44... by Alberto Mardegan

Merge pull request #11560 from mardy/restore-conflict-nocleanup

overlord: execute snapshot cleanup in task

b93cf4e... by Alberto Mardegan

cmd/snap-confine: replace leftovers of SC_LIB

ac20548... by Alberto Mardegan

Merge branch 'master' into mount-support-cleanups

5630fec... by Michael Vogt

Merge pull request #11819 from mardy/accounts-service-introspect

i/b/accounts_service: fix path of introspectable objects

735c02a... by Michael Vogt

Merge pull request #11822 from bboozzoo/bboozzoo/funny-pi-gpu-with-mesa

interfaces/opengl: update allowed PCI accesses for RPi

d68e31d... by Frederik Du Toit Lotter

configcore: add core.system.ctrl-alt-del-action config option

* configcore: add core.system.ctrl-alt-del-action config option

The ctrl-alt-del keyboard sequence is detected by the Linux kernel and
signalled to systemd (SIGINT). Systemd provides a special hook, the
ctrl-alt-del.target unit, which will be started when the request is received.

The default systemd installation includes the hook under
/lib/systemd/system/ctrl-alt-del.target, symlinked to the
/lib/systemd/system/reboot.target. This means by default a ctrl-alt-del event
will cause the system to restart.

When the ctrl-alt-del.target is masked, systemctl will create another version
of the target under /etc/systemd/system, pointing to /dev/null. The /etc
directory is searched for unit files before the /lib directory, allowing the
installed behaviour to be overwritten.

bash$ systemctl mask ctrl-alt-del.target
Created symlink /etc/systemd/system/ctrl-alt-del.target → /dev/null.

Add the ability to define the behaviour when a user presses the ctrl-alt-del
keyboard sequence.

overlord/configstate/configcore/ctrlaltdel.go:

- Add a system level configuration option (similar to
  core.system.power-key-action)

- Add "none" and "reboot" as valid action options

- Add code to verify the required systemd hooks are in place (the
  ctrl-alt-del.target is installed and in disabled or masked state)

overlord/configstate/configcore/ctrlaltdel_test.go:

- Add unit tests for verifying success and failure cases

tests/core/snap-set-core-config/task.yaml:
tests/nested/manual/core20-early-config/task.yaml:

- Add spread test support for ctrl-alt-del-action

The ctrl-alt-del configuration item can be applied from the gadget snap
(meta/gadget.yaml) or by using the 'snap' client:

Test results:

bash$ snap set core system.ctrl-alt-del-action=none
bash$ snap get core system.ctrl-alt-del-action
none

bash$ systemctl status ctrl-alt-del.target
ctrl-alt-del.target
     Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.)
     Active: inactive (dead)

bash$ snap set core system.ctrl-alt-del-action=reboot
bash$ snap get core system.ctrl-alt-del-action
reboot

bash$ systemctl status ctrl-alt-del.target
reboot.target - Reboot
     Loaded: loaded (/lib/systemd/system/reboot.target; disabled)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

Tested the system.ctrl-alt-del-action=none action on QEMU (Ubuntu Core).
Running QEMU 'sendkey ctrl-alt-delete' from the QEMU control interface
does not generate a reboot, while the 'reboot' action allows the reboot to
take place.

LP: https://bugs.launchpad.net/snappy/+bug/1929539

Signed-off-by: Fred Lotter <email address hidden>

* Spead Test Fixes for Ubuntu Core <= 18

* Michael Review Improvements

* Alberto Review Improvements

* Alberto Review Improvements #2

* configcore: update to match latest master

* configcore: use `fmt.Fprintf(Stderr` in sysdCtrlAltDelLogger.Notify() for consistency with the loger loggers we create

* configcore: simplify code in switchCtrlAltDelAction (thanks to Maciej)

* configcore: tweak code comment (thanks to Maciej)

* configcore: add test for filesystem only apply for system.ctrl-alt-del-action (thanks to Samuele)

* configcore: tweak tests for ctrl-alt-delete

* configcore: fix non-inclusive naming

* tests: check --property=LoadState for system.ctrl-alt-del-action

Co-authored-by: Michael Vogt <email address hidden>