Testers for next inxi (pinxi) - USB, Bluetooth, USB upgrades

hmm, ok, now it's getting strange, this data comes from a perl builtin that is simply queryingi the OS to get this data, I am unable to see why it's not getting it, but this appears to be a perl on hardware bsd issue, as far as I can tell. But we're running the same systems, with the same perl installed, so this makes little to no sense.

Maybe I'll add in one fallback, of running the tty command directly

Another possibility is that somehow, the $XDG_VTNR environmental variable is set but empty, that's the only way I can see it would fail.

I can't see any way our systems should be different in this regard, for me, this always works, it works on remote systems running freebsd, it works on all my test systems, it always works on linux, it works over ssh, but yours are consistently not there, no matter what.

There's a few guesses left, but none of them should be the case, and the fact that your tty has output that is what I expect to see makes this even more puzzling, since all really inxi is doing is using a universal perl wrapper for the tty command, give or take, but I can find NO documentation about what that really is doing at all, nowhere, it's so standard and normal that I think the world has never thought to document it completely.

Basically anything I would try would be a pure guess, though the plus side is that to get this resolved, I had to finally fix and recode a bunch of really weird redundant and hard to follow blocks of logic, so that's all shipshape now, but the original problem remains.

The only difference I can see is that you made your accounts without a regular user, only root, but that should NOT make a difference since when you login as root, it's the same in theory as my logging in as root, it shouldn't make a difference.

maybe one other possible difference, you have no logins? there were several options on these setups, but I dont' remember openbsd offering no login as an option.

You are logging in, correct? You must be, since your console shows the (login) but maybe that wuold appear without a login.
 
Last edited:


Yeah, these are all pretty fresh installs here. Perl was not always included originally, but installing inxi brought it in with many other items. OpenBSD did not have inxi in the repositories though, so I guess Perl was already included.

I have 3 of the systems running and can quickly run any tests there. Nomad would require me to log off of this computer to run it though, and it's very slow to boot and run on USB.
 
maybe one other possible difference, you have no logins? there were several options on these setups, but I dont' remember openbsd offering no login as an option.

You are logging in, correct? You must be, since your console shows the (login) but maybe that wuold appear without a login.
I have tried to always login as root. Nomad has a regular user named Nomad I can use, but I open tty instead and login as root. I have user accounts 'stan' on at least 2 others, but maybe not FreeBSD 13, but I will be glad to add a user there too.

Do you want some commands executed as a regular user?
 
Code:
perl -MPOSIX -e 'print POSIX::ttyname(1),"\n";'

If you can run this on those systems, that may give some help, that's basically what pinxi is running, minus 25,000 plus lines of code, lol.
 
Last edited:
By the way, what is interesting here is that there is a tiny difference that exists, that creates this situation, but the mystery is to figure out what that difference is. I've never seen this issue on any system, but I don't say that to condemn or suggest error, but rather to show that some assumption I've made about something always being one way is not actually right, so you're doing a great job doing things slightly differently to trigger such events or failures.
 
OK, I'll start with just 3 running systems and save Nomad unless needed. Be right back...

I get an error about the \ character on the Asus. Same error on OpenBSD.

Removing \n then gives no output on the above 2 systems.
 
Last edited:
Code:
perl -MPOSIX -e 'print "xdg:", $ENV{XDG_VTNR}, " pos:",  POSIX::ttyname(1),"\n";'

this is harder to copy/type, but duplictes exactly what pinxi is testing.

I made a typo in the first one, I'm really bad at doing command line perl, I fixed the first one, and the second one is the full set of data, that, sadly, exposed that a long standing assumption I'd made internally is in fact not right...
Code:
perl -MPOSIX -e 'print "xdg:", $ENV{XDG_VTNR}, " pos:",  POSIX::ttyname(1),"\n";'
xdg:7 pos:/dev/pts/11

I had assumed XDG_VTNR and ttyname gave the same result, but they don't.
 
Code:
perl -MPOSIX -e 'print "xdg:", $ENV{XDG_VTNR}, " pos:",  POSIX::ttyname(1),"\n";'

this is harder to copy/type, but duplictes exactly what pinxi is testing.
Ok, just a minute...

That's a tough one! LOL. On just the Asus, I get no output. I think I have it typed correctly, with curly braces and all.
 
Last edited:
I don't see a change in the first one. You want the 2nd one run, with the additional stuff on the 2nd line?
 
This is slightly simpler:

Code:
perl -ws -MPOSIX -e 'print "xdg:$ENV{XDG_VTNR} pos:",  POSIX::ttyname(1),"\n";'

I forgot the -ws, that triggers strict output with warnings, which we want in this case since if XDG_VTNR is defined by empty, that will cause the failure, but if it's not defined it will just not be used. With -ws perl won't let you use undefined variables in print without spitting out an error, but if you do not see that error, and xdg: is empty, that's why it's not working, but if POSIX::ttyname(1) is also empty, then we're looking at a very profound mystery.
 
OK, just a minute...

Bareword found where operator expected at -e line 1, near "xdg:&ENV{XDG_VTNR} pos:" POSIX::ttyname"
(Missing operator before POSIX:: ttyname?)
syntax error at -e line 1, near ""xdg ... same as above
Execution of -e aborted due to compilation errors.
 
Sample with undefined, note that I misspelled the XDG_VTNRs to make it be undefined:

Code:
perl -ws -MPOSIX -e 'print "xdg:$ENV{XDG_VTNRs} pos:",  POSIX::ttyname(0),"\n";'
Use of uninitialized value $ENV{"XDG_VTNRs"} in concatenation (.) or string at -e line 1.
xdg: pos:/dev/pts/11
 
I added 's' as in XDG_VTNRs but same error, Bareword, etc.
 
Will these run in Linux? I can easily copy/paste here to test syntax. Then I can open Firefox in the BSD's to copy/paste from there. I think I am typing okay, but maybe not... its pretty complex.
 
The code in post #110 above seems to run in Linux, and outputs:
xdg:7 pos:/dev/pts/0
 
If you're seeing a bareword error, you made a typo.
I'm not surprised! LOL. I just loaded GUI on Asus as root, running firefox and will copy from post #110 in just a sec...
 
note that when I run this in Freebsd 13 beta 1, I get:

Use of undefined value... [which is what I expect since that XDG is not defined usually in BSDs, if ever]
xdg: pos:/dev/ttyv8

same result as root in console. So the XDG is almost certainly undefined, which is what I expect, and ttyname(1) is returning the tty. And that long command is basically just reproducing the output of 'tty', but there's a difference between running these commadns in a script or in the shell directly.
 
root@freebsd:~ # perl -ws -MPOSIX -e 'print "xdg:$ENV{XDG_VTNR} pos:", POSIX::ttyname(1),"\n";'
Use of uninitialized value $ENV{"XDG_VTNR"} in concatenation (.) or string at -e line 1.
xdg: pos:/dev/pts/0

This is FreeBSD 12.2 above... installed on Asus laptop. Copy/pasted from post #110.
 
But I'm still not getting the ttyname... bummer
 

Members online


Latest posts

Top