snapd 2.59 behaves different regarding sysemctl
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
The CERT team reported the following issue. The "systemctl" binary for devmode snaps reports different statues when running on pre-2.59 snapd and post 2.59 snapd. The culprit is probably https:/
They report the following https:/
So under 2.59 systemctl seems to think it's running inside a chroot when run from a snap shell.
The slightly annoying part is that I cannot reproduce this with my regular 22.10 machine.
For me even with snapd/edge (2.59) it does not error:
"""
$ snap version
snap 2.58.1+
snapd 2.58.1+
series 16
ubuntu 22.10
kernel 5.19.0-29-generic
$ sudo snap install checkbox22
...
$ sudo snap install --classic checkbox
...
$ sudo checkbox.shell
[sudo] password for egon:
checkbox runtime shell, type 'exit' to quit the session
# systemctl is-active checkbox-ng.service
inactive
# echo $?
3
"""
Fwiw, systemd defines: in_chroot( void) {
"""
int running_
int r;
if (getenv_ bool("SYSTEMD_ IGNORE_ CHROOT" ) > 0)
return 0;
r = files_same( "/proc/ 1/root" , "/", 0);
return r;
if (r < 0)
return r == 0; /github. com/snapcore/ snapd/pull/ 11367 setting up a scratch dir for "/" this seems to be the culprit.
}
"""
and with https:/