Hello, First, thanks for all your recent work on portage-utils and qlop in particular. One thing that got lost in 0.80 is the ability to see inside chroots. Is it possible to add this back, for qlop -r on 0.80? Old (0.74) behavior: $ qlop -c * sys-devel/gcc-9.2.0 started: Thu Aug 15 11:29:37 2019 elapsed: 51 seconds * www-client/firefox-68.0.2 started: Thu Aug 15 10:25:23 2019 elapsed: 1 hour, 5 minutes, 5 seconds * net-irc/irssi-1.2.1 started: Thu Aug 15 11:30:24 2019 elapsed: 4 seconds chroot: /root/gentoo-systemd $ Thanks!
Hmmm, what do you mean with "inside chroot"? From itside the chroot, or are you lacking ROOT support?
In 0.74, I could run "qlop -c" from outside the chroot, and it would see the emerges going on inside chroot. https://gitweb.gentoo.org/proj/portage-utils.git/tree/qlop.c?id=054b993a9433a45c00086fb2841a8150d85eb437#n470 It would also (if run as root) show the chroot path by reading /proc/*/root.
Yeah, I just figured, because it was looking up sandbox in the process list.
I think what I can do is make qlop respect ROOT, such that it would operate like other tools that out outside the chroot but work in the chroot. You won't get a "free" pass to see your chroot emerges from outside the chroot without help. I can't see how to "detect" chroots, except from bringing the botched process list checking code back. Note that some people plan on removing sandbox, so the process was unreliable.
Is it really that impossible? for i in $(pgrep emerge); do readlink /proc/${i}/root; done Is that too hacky?
(In reply to Ben Kohler from comment #5) > Is it really that impossible? > > for i in $(pgrep emerge); do readlink /proc/${i}/root; done > > Is that too hacky? I guess that makes a pretty good alias or script if you want it to work...
Yes, if you are giving up on implementing this feature, that is what I'll do. If you do not think you can reliably find the PID of a running emerge, this surprises me, but I won't argue about it.
FYI the above for loop wasn't meant to be implemented as-is, of course. Just illustrating that it can be done.
(In reply to Ben Kohler from comment #8) > FYI the above for loop wasn't meant to be implemented as-is, of course. > > Just illustrating that it can be done. It's difficult, in particular cross-platform, the process listing code isn't nice either. The only reason to put it in, would be to suit this particular case.
Ah, I wasn't thinking about other platforms. If you can add ROOT= support, I can write the necessary wrapper on my end. Thanks!
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=74219ab70d2a5bcad327c3795f5fa9b881d433ad commit 74219ab70d2a5bcad327c3795f5fa9b881d433ad Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2019-08-17 08:35:39 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2019-08-17 08:35:39 +0000 qlop: add ROOT support, bug #692224 Respect ROOT when set, to ease scripting of qlop interaction with chroots. Bug: https://bugs.gentoo.org/692224 Signed-off-by: Fabian Groffen <grobian@gentoo.org> qlop.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b04f542749e2fb95c627364bf58b075c164c4f6 commit 0b04f542749e2fb95c627364bf58b075c164c4f6 Author: Fabian Groffen <grobian@gentoo.org> AuthorDate: 2019-10-20 10:25:14 +0000 Commit: Fabian Groffen <grobian@gentoo.org> CommitDate: 2019-10-20 10:25:38 +0000 app-portage/portage-utils: version bump to v0.81 - 697094: qfile incorrectly matching /usr/lib - 697068: qlop -r not showing ongoing merges from parallel merges - 696078: qgrep not matching revisioned ebuilds - 695586: qpkg double frees and incorrect unpacking - 694972: qlop -r/-a speedups - 692224: qlop support for alternate ROOT - 677982: qfile report matches from prune lib registry Closes: https://bugs.gentoo.org/697094 Closes: https://bugs.gentoo.org/697068 Closes: https://bugs.gentoo.org/696078 Closes: https://bugs.gentoo.org/695586 Closes: https://bugs.gentoo.org/694972 Closes: https://bugs.gentoo.org/692224 Closes: https://bugs.gentoo.org/677982 Package-Manager: Portage-2.3.76, Repoman-2.3.16 Signed-off-by: Fabian Groffen <grobian@gentoo.org> app-portage/portage-utils/Manifest | 1 + .../portage-utils/portage-utils-0.81.ebuild | 87 ++++++++++++++++++++++ 2 files changed, 88 insertions(+)