Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many: use transient scope for tracking apps and hooks #7825

Merged
merged 199 commits into from
Aug 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
1fe1294
many: use transient scope for tracking apps and hooks
zyga Nov 20, 2019
97fd304
tests: correct old comment
zyga Nov 29, 2019
95f7808
sandbox/cgroup: drop unused PidsInGroup
zyga Nov 29, 2019
4cc2daa
overlord/snapstate: test extra cgroup path variants
zyga Nov 29, 2019
4dd4b1f
overlord/snapstate: use filepath.Base instead of Split
zyga Nov 29, 2019
5e70b7e
overlord/snapstate: use filepath.Dir instead of Split
zyga Nov 29, 2019
83412d5
overlord: fix typo 'dot'
zyga Dec 2, 2019
1657075
overlord: fix typo 'processes'
zyga Dec 2, 2019
784be6c
overlord: spurious newline
zyga Dec 2, 2019
8d54aae
overlord: add missing dot
zyga Dec 2, 2019
81a4f07
tests: fix typo "systemd"
zyga Dec 2, 2019
064fe38
tests: tweak wording
zyga Dec 2, 2019
f3ab8c0
tests: add missing comma
zyga Dec 2, 2019
3e2fafa
overlord: fix typo 'harvest'
zyga Dec 2, 2019
af69fdb
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Dec 3, 2019
4f7e9b4
tests: reword stale comment about /run/snapd/cgroup
zyga Dec 3, 2019
1fe98e4
overlord/snapstate: clarify locking of refresh checks
zyga Dec 3, 2019
9f693ff
overlord: handle trailing slash in securityTagFromCgroupPath
zyga Dec 3, 2019
5c75d8d
cmd/snap: reformat code around dbus call
zyga Dec 3, 2019
af261f7
Merge remote-tracking branch 'zyga/feature/refresh-app-awareness-v2' …
zyga Dec 3, 2019
9e5b4e1
overlord,sandbox: move pidsOfSnap to sandbox/cgroup
zyga Dec 3, 2019
d267f0a
sandbox: add comment about cgroup -> security tag
zyga Dec 3, 2019
1a3cfdb
sandbox/cgroup: verify that snap.*.scope is handled ok
zyga Dec 4, 2019
41f5e69
sandbox/cgroup: skip descending after cgorup.procs
zyga Dec 4, 2019
9ffb64a
snap/naming: add validator for snap security tag
zyga Dec 5, 2019
e5104e8
sandbox/cgroup: validate snap security tags
zyga Dec 5, 2019
b94bc21
cgroup/sandbox: scan precisely the right cgroup path
zyga Dec 5, 2019
81bc98d
cmd/snap: reword comment for clarity
zyga Dec 5, 2019
5bccf4b
cmd/snap: add TODO about service cgroups
zyga Dec 5, 2019
0b51f0d
cmd/snap: document properties and auxUnit
zyga Dec 5, 2019
0a52ac1
cmd/snap: explain why we use uniquely named scopes
zyga Dec 5, 2019
ad962c1
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Dec 5, 2019
a4db660
overlord/snapstate: gofmt -s
zyga Dec 5, 2019
59478b9
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Jan 7, 2020
dee513f
Merge branch 'feature/refresh-app-awareness-v2' of github.com:zyga/sn…
zyga Jan 7, 2020
4b21e4e
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Jan 16, 2020
63c8834
tests: fix cgroup-tracking test after test-snapd-sh changes
zyga Jan 16, 2020
a312569
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Feb 10, 2020
e9f4770
sandbox/cgroup: unexport PidsInFile
zyga Feb 10, 2020
203824c
cmd/snap-run: document randomness for scope UUIDs
zyga Feb 17, 2020
931cd24
cmd/snap-run: explain how process accounting works
zyga Feb 17, 2020
06619d9
cmd/snap-run: refer to documentation of StartTransientUnit
zyga Feb 17, 2020
8b0cad9
cmd/snap-run: return distinct error on scope clashes
zyga Feb 17, 2020
ab18ecf
dirs: make CgroupDir private
zyga Feb 17, 2020
0a42051
sandbox/cgroup: correct documentation of PidsOfSnap
zyga Feb 17, 2020
bf1672e
sandbox/cgroup: tweak potentially confusing walker
zyga Feb 17, 2020
63eb30e
sandbox/cgroup: expand documentation of the walker
zyga Feb 17, 2020
5fcafe8
tests: spell out cgroup configurations exercised
zyga Feb 17, 2020
a608532
sandbox/cgroup: verify pid tracking and snapd.service
zyga Feb 17, 2020
680f980
sandbox/cgroup: more tests for parsing pids
zyga Feb 18, 2020
dee754b
sandbox/cgroup: more tests for pid-snap association
zyga Feb 18, 2020
1595339
sandbox/cgroup: add extra test for PidsOfSnap
zyga Feb 18, 2020
3fb428f
sandbox/cgroup: fix typo "correctly"
zyga Feb 18, 2020
2a87a32
sandbox/cgroup: fix typo "encountered"
zyga Feb 18, 2020
691db0c
sandbox/cgroup: fix typo "momentarily"
zyga Feb 18, 2020
f252f80
cmd/snap-run: move debug line to where it should be
zyga Feb 18, 2020
3cfbe93
cmd/snap-run: log if we cannot make transient scopes
zyga Feb 18, 2020
2981dd2
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Feb 21, 2020
9ccdaf5
sandbox/cgroup: document why we scan particular dirs
zyga Feb 21, 2020
e2d28a2
tests: run cgroup tracking test as test and root
zyga Feb 19, 2020
5c3548d
tests: exec commands, not just run them
zyga Feb 19, 2020
b3e660d
sandbox/cgroup: use put rather than bin
zyga Feb 21, 2020
6b1ef3e
sandbox/cgroup: add missing comma
zyga Feb 21, 2020
5f1ad72
sandbox/cgroup: use "from it" instead of "from one"
zyga Feb 21, 2020
878e4ee
sandbox/cgroup: don't capitalize after colon
zyga Feb 21, 2020
dbe888d
sandbox/cgroup: among ... results, not result
zyga Feb 21, 2020
162ad6d
sandbox/cgroup: improve comment clarity
zyga Feb 21, 2020
d08b2d7
sandbox/cgroup: say "for a" instead of "of a"
zyga Feb 21, 2020
170f45d
sandbox/cgroup: fix incorrect wording
zyga Feb 21, 2020
6e869f1
cgroup/sandbox: plural processes
zyga Feb 21, 2020
d484820
sandbox/cgroup: fix some more grammar
zyga Feb 21, 2020
61c52ba
cmd/snap: reword comment about randomness quality
zyga Mar 2, 2020
2b790c9
cmd/snap: tweak comment wording
zyga Mar 2, 2020
2eb8d72
cmd/snap: tweak more comments
zyga Mar 2, 2020
442af4e
cmd/snap: fix wording and refer to upstream docs
zyga Mar 2, 2020
d46cede
cmd/snap: rewrite documentation of scope placements
zyga Mar 2, 2020
770b631
cmd/snap: add TODO to invert scope names
zyga Mar 2, 2020
ff6c4f2
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Mar 2, 2020
fe06c35
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Mar 4, 2020
f2bbef7
tests: improve quoting situation in session-tool
zyga Mar 5, 2020
abfba72
tests/session-tool: allow tracking playload pid
zyga Mar 18, 2020
c9df481
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Mar 25, 2020
1b0102a
cmd/snap: handle ChildExited erorr
zyga Mar 26, 2020
63cf546
cmd/snap: verify effective path in the tracking cgroup
zyga Apr 2, 2020
5c183ef
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 2, 2020
c42ae4f
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 3, 2020
455d361
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 4, 2020
f4f56d5
tests: fix leftovers from bad merge
zyga Apr 4, 2020
f6fe41d
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Apr 7, 2020
4c398a1
Merge remote-tracking branch 'zyga/feature/refresh-app-awareness-v2' …
zyga Apr 7, 2020
328b656
tests: disable cgroup-tracking for core20
zyga Apr 7, 2020
c3d8673
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 7, 2020
b6263eb
Merge branch 'feature/refresh-app-awareness-v2' of github.com:zyga/sn…
zyga Apr 7, 2020
f7d3351
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 8, 2020
a44a723
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 8, 2020
f095fb8
tests: remove pid and stamp files
zyga Apr 8, 2020
7e25661
testutil: add NewDBusTestConn
zyga Apr 15, 2020
5901899
cmd/run: early work for testing dbus in snap-run
zyga Apr 14, 2020
0ca4371
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 17, 2020
ebfe55c
tests: remove, not install
zyga Apr 17, 2020
6a21bf2
cmd/snap: document the sgnificance of scope names
zyga Apr 20, 2020
af3e32c
cmd/snap: highlight reasons for chioce of uniqueness
zyga Apr 20, 2020
99760e4
tests: rename pidN_session to sessionN_pid
zyga Apr 20, 2020
63129f2
tests: clarify that snap run performs cgroup transition
zyga Apr 20, 2020
9c6c0e8
cmd/snap: document doCreateTransientScope
zyga Apr 20, 2020
259bba9
cmd/snap: de-duplicate doCreateTransientScope comment
zyga Apr 20, 2020
6c7b16a
sandbox/cgroup: test variant with two users
zyga Apr 20, 2020
410d24e
many: gofmt 1.6
zyga Apr 20, 2020
8e6b4e0
tests: pass -y to apt-get
zyga Apr 20, 2020
35759e2
cmd/snap: ignore failures to connect session bus
zyga Apr 20, 2020
0eb37d7
cmd/snap: handle session bus failure better
zyga Apr 21, 2020
0f6e01e
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 21, 2020
9ff3f37
cgroup: use .mount unit in TestPidsOfSnapUnrelatedStuff
zyga Apr 22, 2020
fd5b359
tests: pass SNAPD_DEBUG SNAP_CONFINE_DEBUG via session-tool
zyga Apr 22, 2020
9c7a077
tests: use pkill rather than killall
zyga Apr 22, 2020
1d1ba50
cmd/snap: do not activate systemd with dbus calls
zyga Apr 22, 2020
5283453
cmd/snap: handle NameHasNoOwner
zyga Apr 22, 2020
c1dc8bf
tests: show how app tracking can fail
zyga Apr 22, 2020
62df1dd
cmd: fix typo
zyga Apr 23, 2020
4aca460
tests: measure tracking on core systems
zyga Apr 23, 2020
01c4994
tests: re-enable cgroup-tracking on core20
zyga Apr 23, 2020
ed53d3e
tests: add theory to 16vs18 mystery
zyga Apr 23, 2020
1130a24
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Apr 23, 2020
08d28d1
tests: fixup grep pattern
zyga Apr 23, 2020
988e2b2
tests: explain why cgroup-tracking test fails on core20
zyga Apr 23, 2020
661013c
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 5, 2020
64f24fd
Merge branch 'feature/refresh-app-awareness-v2' of github.com:zyga/sn…
zyga May 5, 2020
3175992
tests: adjust cgroup-tracking-failure after core20 updates
zyga May 5, 2020
29973aa
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 5, 2020
a5d850a
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 6, 2020
3ba26e3
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 15, 2020
acdd12b
cmd/snap,cgroup: put swap UUID and security tag
zyga Apr 24, 2020
0385998
tests:adjust the cgroup-tracking-failure test
zyga May 18, 2020
cab32c9
dbusutil: move DBus utilities to new package
zyga May 19, 2020
7923ee5
dbusutil: add dbustest package
zyga May 19, 2020
7d0700b
sandbox/cgroup: move CreateTransientScope
zyga May 19, 2020
a5978af
cgroup/sandbox: remove ControllerPathV1
zyga May 19, 2020
c486fd8
cgroup: add TODO about cgroup v2 support
zyga May 19, 2020
b3c7983
cgroup: test session -> system bus fallback
zyga May 20, 2020
f9d5598
cgroup: test doCreateTransientScope error paths
zyga May 20, 2020
a0bfe81
tests: remove sleep 3 left over from debugging
zyga May 20, 2020
0844973
cgroup: drop implemented TODO
zyga May 20, 2020
0efb670
cgroup: typo "IDs"
zyga May 20, 2020
9b390bf
dirs: remove unused cgroup dirs
zyga May 20, 2020
4c84ff4
cgroup: modernize directory definition
zyga May 20, 2020
5d01bff
cgroup: make doCreateTransientScope mockable
zyga May 21, 2020
79065ab
cgroup: add more test for CreateTransientScope
zyga May 21, 2020
caa0a59
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 21, 2020
c9bfc5e
cgroup: swap getting uuid and connecting to dbus
zyga May 21, 2020
3df510d
cgroup: fix typo "immediately"
zyga May 21, 2020
5dc1d5a
cmd/snap: simplify mocking of CreateTransientScope
zyga May 21, 2020
130234d
cgroup: add ConfirmSystemdServiceTracking
zyga May 21, 2020
e1268bf
cmd/snap: verify existing tracking of systemd services
zyga May 21, 2020
cab868a
tests: fix emulation of disabled dbus service
zyga May 21, 2020
d0c8920
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 27, 2020
36a038e
tests: do not install/remove dbus-user-session
zyga May 27, 2020
c27006a
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga May 27, 2020
376d9f0
snap/naming: add ParseSecurityTag and friends
zyga May 27, 2020
750f69d
cgroup: replace pathOfPidCgroup with ProcPidPath
zyga May 27, 2020
8db540d
cgroup: extend SnapNameFromPid to support tracking cgroup
zyga May 27, 2020
76e6502
cgroup: improve tests for SnapNameFromPid
zyga May 27, 2020
42bd887
cgroup: mock version of cgroup in tests
zyga May 27, 2020
c69ace1
cgroup: make writePids aware of cgroup version
zyga May 27, 2020
f8f5805
cgroup: test PidsOfSnap in cgroup.V2 mode
zyga May 27, 2020
c28232d
cgroup: document use of SkipDir
zyga May 27, 2020
e9ffd13
dbusutil: add missing unit tests
zyga May 27, 2020
20282f0
cgroup: use dbustest.StubConnection
zyga May 27, 2020
c71db58
dbusutil: tweak name of mock functions
zyga May 27, 2020
14802d7
cgroup: ensure unrelated files are not scanned
zyga May 27, 2020
a35d1a3
Merge branch 'feature/dbusutil' into feature/refresh-app-awareness-v2
zyga May 29, 2020
381956c
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jun 4, 2020
b7413fb
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jun 10, 2020
0d2b826
Merge branch 'feature/tracking-broken-out' of github.com:zyga/snapd i…
zyga Jun 15, 2020
445c4b0
sandbox/cgroup: allow discovering PIDs of given snap
zyga Jun 15, 2020
276a799
Merge branch 'feature/scanning-broken-out' into feature/refresh-app-a…
zyga Jun 15, 2020
4a7a6f3
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Jun 26, 2020
4406d10
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jun 29, 2020
03c780c
tests: stop root's session dbus.service
zyga Jun 29, 2020
49783ab
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jul 1, 2020
0981297
sandbox: drop unneeded test helper
zyga Jul 1, 2020
e63df5b
sandbox/cgroup: remove unused PidsInGroup
zyga Jul 1, 2020
4dc3ad3
tests: stop root session dbus when restoring
zyga Jul 1, 2020
2f27544
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jul 2, 2020
97cc789
tests: explicitly remove lxd and lxd-demo-server
zyga Jul 2, 2020
d99334f
tests: explicitly stop root session dbus.service
zyga Jul 2, 2020
d92c237
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jul 3, 2020
dfe8bf5
tests: update stale reference to version-tool
zyga Jul 3, 2020
b9ece6d
Merge branch 'feature/track-launched-apps' into feature/refresh-app-a…
zyga Jul 6, 2020
90cb8c0
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jul 6, 2020
1e36b55
Merge branch 'feature/track-launched-apps' into feature/refresh-app-a…
zyga Jul 8, 2020
ba7c62d
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jul 8, 2020
eecdbf7
cmd/snap: remove workaround for racy systemd
zyga Jul 8, 2020
70a3fc8
Merge branch 'feature/track-launched-apps' into feature/refresh-app-a…
zyga Jul 17, 2020
9cf375c
Merge branch 'feature/track-launched-apps' into feature/refresh-app-a…
zyga Jul 24, 2020
dd216a6
cmd/snap: remove unused EnableFeatures test helper
zyga Jul 24, 2020
91df251
Merge branch 'master' of git://github.com/snapcore/snapd into feature…
zyga Jul 24, 2020
3cbaf89
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Aug 6, 2020
09a32df
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Aug 10, 2020
56c8312
Merge branch 'master' of github.com:snapcore/snapd into feature/refre…
zyga Aug 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion overlord/snapstate/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func pidsOfSnap(snapInfo *snap.Info) (map[string][]int, error) {
if filepath.Base(path) != "cgroup.procs" {
return nil
}
cgroupPath, _ := filepath.Split(path)
cgroupPath := filepath.Dir(path)
cgroupPath = filepath.Clean(cgroupPath) // Drops trailing /
zyga marked this conversation as resolved.
Show resolved Hide resolved
securityTag := securityTagFromCgroupPath(cgroupPath)
if securityTag == "" {
Expand Down