The small linux problem thread

Nah I have it just on my daily PC. I just wanted to see how well it works, don’t have a use for it (yet) since NAS is dead.

I thought that shit was relatively new.

1 Like

But they innovate so fast they don’t even use it anymore! :scream:

1 Like

Ironically, this has been the most stable part of Gentoo for me. I’ve always had trouble version matching zfs and DKMS stuff, but Gentoo just kinda does it for me (not just kinda, there’s package blocking and yada yada). I just installed Gentoo and Gnome on a new (to me) laptop, and everything worked out of the box. ZFS, wifi, touchscreen.

I’m also not saying “Your Distro Sucks”, I’m just always shocked when I find areas where Gentoo is actually MORE stable than other distros

1 Like

there is Kernel pinning, I just didn not read the notes before updating. Hey ho, was a little fun.
I know I had the same thing happen in Arch before, but I switched away from that a while ago for the stability of LTS. I miss the cutting edge features sometimes, but I can live with a little less fun in my life

1 Like

10 posts were split to a new topic: Quirky zsh behavior with file descriptors

What’s the flatpak equivalent of apt update and dnf check-update? I see flatpak upodate --no-deply but that downloads the updates. I just want to list available updates.

I don’t use them much so this is just a random guess from the man pages.

Maybe try, this ?

 flatpak remote-ls --updates

(it will pull metadata, not sure about anything else)

       --updates
           Show only those which have updates available.

(there are some other flags to show all and such that may be needed or to change the output)

Otherwise hopefully doesn’t require finding some output in other commands that happen to indicate status, or not a manually scripted pipe chain of getting info for each one in the remote and comparing dates… but I’d hope there was something better. (or maybe some lower ostree commands by chance)

Unfortunately I don’t have any on the current systems to play with, so this is just a quick guess that may be incorrect; without googling. Just figured I’d toss that one in there if not checked yet.

1 Like

Based on this github issue, I think you’re right. Although looks like it might be buggy.

1 Like

darn. good to know. (and maybe also some issues with their remotes and oci) Thanks for following up with the warning.

1 Like

I don’t think there’s a way to do this other than tracking it in a variable, but when I source a script in a script, is there a reliable way for the child script to know the name of the parent?

I can see the topmost script with ps -p $$ -o command='' but if I have multiple levels of sourcing, I don’t know how to get the immediate parent.

Example:

test.sh

#!/usr/bin/env bash

source test1.sh

test1.sh

source test2.sh

test2.sh

ps -p $$ -o command= #prints "bash test.sh"
#how do detect test1.sh as the immediate parent?

./test.sh

Again, from what I can find you can’t do it, but it’s always possible I missed something.


Funny workaround:

test1.sh

echo $0 | source test2.sh

test2.sh

[ -p '/dev/stdin' ] && read -r parent
echo $parent
unset parent

Saves a declaration in test1.sh and doesn’t mess with $@

1 Like

In this case I think you may be able to rely on the builtin source tracking in bash?

A quick test/example that could be added in one of the later ‘children’ examples you mentioned:

for i in ${!BASH_SOURCE[@]}; do echo "${BASH_SOURCE[i]} <-";done;
echo grand_parent:${BASH_SOURCE[${#BASH_SOURCE[@]}-2]}
$ bash -c 'echo ${BASH_SOURCE[0]} -- ${#BASH_SOURCE[@]}'
-- 0

Of course:

  • some logic to see if you are only 1 deep before subtracting 2, is needed in the example above (and maybe striping of the path if needed, etc)
  • it won’t apply for any need to track parent processes (run-by rather that sourced).
$ MANWIDTH=70 man bash | grep BASH_SOURCE -C2
              in source files where  each  corresponding  member  of
              FUNCNAME  was invoked.  ${BASH_LINENO[$i]} is the line
              number in the source file (${BASH_SOURCE[$i+1]}) where
              ${FUNCNAME[$i]} was called (or ${BASH_LINENO[$i-1]} if
              referenced within another shell function).  Use LINENO
--
              nth parenthesized  subexpression.   This  variable  is
              read-only.
       BASH_SOURCE
              An  array  variable whose members are the source file‐
              names where the corresponding shell function names  in
              the  FUNCNAME  array  variable are defined.  The shell
              function  ${FUNCNAME[$i]}  is  defined  in  the   file
              ${BASH_SOURCE[$i]}        and        called       from
              ${BASH_SOURCE[$i+1]}.
       BASH_SUBSHELL
              Incremented by one within each  subshell  or  subshell
--

              This   variable  can  be  used  with  BASH_LINENO  and
              BASH_SOURCE.  Each element of FUNCNAME has correspond‐
              ing   elements   in  BASH_LINENO  and  BASH_SOURCE  to
              describe  the  call  stack.   For  instance,   ${FUNC‐
              NAME[$i]}     was     called     from     the     file
              ${BASH_SOURCE[$i+1]}       at       line        number
              ${BASH_LINENO[$i]}.   The  caller builtin displays the
              current call stack using this information.

There are several internal things exposed via BASH_* and other variables, with more in the “Shell Variables” section of man bash you’ve probably used at some point, though many might never end up used. I always forget them, but knowing they’re in there somewhere helps.

Since bash isn’t staring a new process when something is source’d, indeed we unfortunately can’t simply look for parent processes if sourced instead of run as a command, but that is fine/useful tradeoff (ie. ps -o ppid= $$ or using pstree -lp -s $$ and similar does not really work in the case of sourcing). (remembering the pitfall of thinking it’s ok to run ‘exit’ in a /etc/profile.d script that is sourced into the interactive shell of the user during login; which promptly logs them out)

Regarding the funny method :slight_smile: , I think that can work. I’m not sure I’ve ever tried piping into a sourced script.

{side story} I believe it should be ok resources wise, but I was suddenly reminded of someone that once had a fancy batch processing system using ksh coprocesses that all dumped their data back to the parent over a named pipe. It does not apply here as it was many to a single pipe, but they claimed (and were) hitting a limit on the total processes they could have, but I was able to confirm that the parent process was waiting for all children to finish, so eventually the pipe would fill due to kernel side rmem/wmem resource limits being hit and children would block on it and not exit. Leading up to it we could confirm that the ‘limit’ on total process (before the remaining ‘hung’) was proportional to the amount of data each job was reporting back… :innocent: and shortly after that were allowed to check /proc/<pid>/stack and strace to confirm it was blocking on writing to the one pipe… the parent was never reading -any- the data off until all children were finished, hence everything halted. The immediate fix, though not really ideal was raising the usual socket tuning on the kernel side. (to the amount they had raised it on the “but it’s clearly working without issue on this other system~” 's relevant sysctl values.

2 Likes

It’s late so I’ll test it tomorrow, but I think this will work (still trying to maintain zsh/bash interoperability).

# assuming KSH_ARRAYS is set
declare -r parent="$( basename "${funcsourcetrace[1]-$BASH_SOURCE[1]}" |
                      sed 's/:[[:digit:]]*$//'  )"

This isn’t really a problem, but gaming… KDE Neon vs Manjaro. I really do love KDE Neon, the plans are passthrough later when I have bought another GPU. Where I use Linux for the everyday Netflix, Youtube etc, while I use a Windows 10 VM for games. KDE Neon is built from Ubuntu. Is a passthrough even manageable on that Distro?

I also have another question. I bought 32GB memory and I kind of want 64GB total for a VM computer, but the memory that I bought have been stopped in production, I can’t get them anywhere in Sweden, even tried Amazon and they have taken them out there too, was there something wrong with them?

How do I check the Vulcan version?

Got a weird problem with running Firefox under firejail. Depending on the install, it either works or doesn’t. Tried on different DE’s all under Fedora 32/33. There doesn’t seem to be any logic to it. For example my brother’s machine with F32 plasma is it refuses, my machine with F32 plasma works but if i run F33 Gnome here it doesn’t work.

Can’t see any weird messages with --debug either.

Being

Is my whole experience lol. Damn shame, too, because it’s much better than the snapz experience.

Oh well, time to find that python3 dependency… :frowning:

1 Like

It had also gotten late by that point for me, maybe 30+ hours “awake”… :persevere: which may partly be why I ended up showing the $i-2 example which was dependent on the number of sourced scripts I used in the quick test; and was talking about grandparents. I though to see if it worked with emulation mode but did not think it wise to try more before sleep.

I believe my friend that has a threadripper setup has plain Ubuntu (version note below), and has a Win10 vm with passthrough for video card. For VR peripherals, the right usb controller had to be passed through too; and at some point had lookingglass at least working in some form (though it may have started to need some changes for lookingglass that he did not bother to go back and try).

EDIT: ubuntu 20.04 LTS with an nvidia card passed through, and another nvidia card for the main linux side desktop.

I’m not sure about KDE Neon specifically; but if wondering about Ubuntu and passthrough in general then it has been working for my friend fairly well.


I’m not certain about the ram at the moment, though maybe someone else will be familiar with if there were any known issues.


You may have sorted this one out already but:

If you mean after it’s installed/setup and maybe working on the system:

  • vulkaninfo may work…
    • On Fedora it’s in the vulkan-tools package, unsure about debian distros at the moment.)
    • The first part of the output may reflect the api version of the installed vulkan driver package.
    • The apiVersion under the sectionVkPhysicalDeviceProperties: may be of interest.

If you mean for your card specific details, but without using commands (if considering buying one):

  • it’s best to check with manufacturer documentation or driver docs, though wikipedia may have a table for the series of cards for a general version upon release, like 1.1,1.2.
  • Some nvidia proprietary driver changelog notes which mention various cards/series: https://developer.nvidia.com/vulkan-driver
  • I’ve also used this site that’s documenting lots of card details when trying to compare my card to others in relation to game debugging. https://vulkan.gpuinfo.org/ (Though that is more about capabilities and the version seen there may depend on the driver etc.)

I’m not sure about the context, but that may help with finding some api version info.

This might end up better in a separate dedicated thread if the number of comments end up going on for a while (though I’m new to the forums).

Hmm… I’ve never used firejail but I just installed it on an older (hardware) but F32 system that is “mostly” updated (latest firejail but firefox and some other things are behind in versions), but

  • It seems to work for me (just run by firejail firefox in my already running Gnome3 X11/Xorg graphical session. It launched and can at least browse a site or two. Just the small ibus connection complaint in the terminal.
  • Versions tested:
    $ rpm -qa firejail firefox gnome-session | sort
    firefox-77.0.1-2.fc32.x86_64
    firejail-0.9.62.4-1.fc32.x86_64
    gnome-session-3.36.0-2.fc32.x86_64
    
  • I’ve not tested with wayland and don’t currently have plasma installed on that system.

Some quick thoughts:

  • It may not be digging deeper but it may be a quick test on your own system or your brothers too, to test creation of a fresh user account and see if it works or is any different behavior. (In case there is some state that is specific to data in your home directory; though it could be a bug or related to different versions of supporting packages; or global state)
    • If it works with a new user account on a system that did not for the normal user, maybe try launching firefox in safe mode as the normal user as another test firejail firefox --safe-mode ?
  • For a moment I thought you said it worked with plasma but not gnome, but it was between F32 and F33 (and also different DE). It may not be related to the desktop environment itself. So a new user account or different DE may not help, but that was a good test.

Some quick questions:

  1. When you say it does not work is it just that it does not start (no window etc and the command run from a terminal exits)? Behavior is the same on F33 Gnome and your brothers system?
  2. Are there any more arguments when launching or is it just firejail firefox in a terminal?
  3. What versions do you have on each system for firejail and firefox (may want to consider other packages as well but for now those are good to check) rpm -qa firefox firejail
  4. Has it worked before on any of the systems that it is not working on now? (did it stop working after any updates, do we know around what day)
  5. Fedora’s firejail seems to provide files in /etc/firejail/ for various application’s needed behaviors (marked as config files), I wonder if old versions are replaced upon upgrades or left behind. You might check running rpm -V firejail on each system to se if there are any modified files in /etc or places that don’t match the current rpm’s version. (maybe unrelated)
  6. When you say F33 gnome and F32 plasma are they separate system or just slightly mixed package sets on the same system?
  7. You’re not already running or seeing a firefox process running for the user prior to starting it with firejail (such as outside firejail in ps aux | grep firefox or an old firejail version etc)? If so it may be good to exit it prior to any testing. I’m not fully familiar with firejail’s behavior and what it allows or does not though.

These are mostly starting questions to clarify a few things. I’m not sure if I’ll be able to help but depending on outcome of any of the above we might have more to go on. I’d suggest getting rpm -qa | sort > /tmp/rpmqa-$(hostname -s).txt and comparing the two F32 systems comm -3 rpmqa-1-.txt rpmqa-2.txt for package version differences in general in case something related stands out, but that is mostly a general tip/step regarding why two systems might be different).

EDIT: hmm, I do see some of the profiles for firejail firefox have whitelist and other things in relation to gnome-shell integartion etc, so maybe it can be related to desktop in some aspects; unsure how much or if it may be in your case.

EDIT2: rambling for myself or others (seems there are things like firejail --trace firefox to list system calls of the application in case it gives a hint about how far it gets) or firejail --allow-debuggers --profile=/etc/firejail/firefox.profile strace -Ttfvys 2048 firefox |& tee ~/firejail-firefox.strace and using --noprofile by itself avoids the firefox profile and causes it to launch but not be able to access internet etc)

2 Likes

I think it’s a rather small problem and fits here fine. Anyway i did some more testing and it’s weird, i made an Arch install inside a vm with gnome wayland and it worked. If i boot the same install on bare metal it does not work. I think i’ll take this to their github and see what they say.
Might be a bug of some sort.

Thanks for thinking along!