snapdtool: update command line when re-executing
Snap re-execution looked confusing since it did not update cmdline in /proc. That means ps, top, systemd-cgls showed /usr/lib/snapd/snapd as running when the binary comes from the snap.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 0.00%. Comparing base (
d6d95f0) to head (396e498). Report is 67 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #14795 +/- ##
===========================================
- Coverage 78.09% 0 -78.10%
===========================================
Files 1190 0 -1190
Lines 158458 0 -158458
===========================================
- Hits 123746 0 -123746
+ Misses 27017 0 -27017
+ Partials 7695 0 -7695
| Flag | Coverage Δ | |
|---|---|---|
| unittests | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
There could be some refinement to do here. For example if argv[0] is just a name without /, meaning it was found from PATH, we do not really have to change argv[0]. So for example calling in the command line snap install steam for example, we should not really need to change snap to the full path, because that would not confuse users if it is actually executing another snap than the one in path.
Ah, we cannot really test it, since SNAPD_DEB_FROM_REPO is used during the preparation for the first test that run on that machine.
I have removed the spread test, since it is not really testable.
That seems to break running apps through symlinks... Maybe we should pass the origin path through environment?
Mon Mar 31 09:03:19 UTC 2025 The following results are from: https://github.com/canonical/snapd/actions/runs/14109922153
Failures:
Executing:
- openstack:debian-sid-64:tests/main/progress
- google:ubuntu-25.04-64:tests/main/microk8s-smoke:edge
- google:ubuntu-22.04-64:tests/main/progress
- google:ubuntu-18.04-64:tests/main/preseed-lxd
@bboozzoo I re-re-request a review, because I had to add conditions on when we rewrite the command line.