The small linux problem thread

Afaik, that sssd config should completely divorce your user/group config from any external directories like ldap.

What are you trying to accomplish with newgrp -? Was the mock group successfully deleted?

Well if I understand the mock user documentation and the man-page for newgrp - right it should reload the current environment and with it all new groups.

It was when I logged out and back in (and also added again after usermodding again)

Ah I see. If you log out and back in does the group membership work as expected? Seems like newgrp is just a convenience, so if it’s not behaving, you can just not use it, right?

Yes that worked as expected. Not sure why newgrp wouldn’t but oh well :man_shrugging:

1 Like

Anyone an idea, how to resolve this?

::1 is an ipv6 local host address.

try setting your programs local host to 127.0.0.1
its likely set to 0.0.0.0 or some other value that isnt ::1
so the program can assign the address to it.

as to how and where you find the setting for it? i have no idea.
maybe an option in a script or webui you can change.
or as a hail Mary
redirect your hosts file 127.0.0.1 0.0.0.0
^^ no idea if this will work. :slight_smile:

1 Like

Thank you, very helpful! I went through the code until I found a config file that sets a variable referencing the hostname to localhost. I changed that to 127.0.0.1 and the program successfully started.

The docker base image for Ubuntu is very sparse and misses everything that is not totally necessary. Do you know of anything that could be missing that could lead to localhost not being resolved to 127.0.0.1?

1 Like

sorry mate.
im new to all this linux ip routing stuff myself.
and pretty much learning as im answering :slight_smile:

1 Like

What is in /etc/hosts?

It should resolve to both.

127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2      80692ff4e537

This is/etc/hosts.

edit:

Forget the below, I somehow managed, I don’t know why it works and at this point I don’t much care. Just leaving it for reference -__-

TLDR (you really don’t need to): Working with ` in a string is a bitch.

Solution was throwing the client ID into a new (bash) variable using twitch_cid='%{_twitch_cid}' and then using that, instead of using the macro/value directly.

Well… I say solution… it’s compiling, who knows if it’ll actually work


OK I need help…
I’ve been banging my head against the wall for like 2 hours now trying to properly escape a goddamn string.

The situation:

  • I have a string (client-identifier), that has multiple ` in it, meaning I need to escape it one way or another
  • I pass that string to mock using --rpmbuild-opts (have to escape the ` there already), which in turn passes it on to rpmbuild as --define
  • I got to the point where I can echo a test-string (without `) in the spec file, but it fails when
  • I need to pass on that string to the %cmake3 macro in the RPM, and need to escape it there too (because of the `).

Here is where it gets hairy. I cannot get it to pass on my test string in quoted form. No matter what I do, it seems to remove the quotes… just now I also found the %{quote:...} macro that should do what I need:

%{quote:…} quote a parametric macro argument, needed to pass
empty strings or strings with whitespace (in >= 4.14.0)

But that’s not working either:

From what I gathered $' ...' in bash (which mock uses), means that it simply expands escape sequences. And in theory that would be cool, except when I test this in bash:

echo $'-DTWITCH_CLIENTID=\037twitch_cid\037'
>>> -DTWITCH_CLIENTID=twitch_cid
echo $'-DTWITCH_CLIENTID=\037abc\`def\037'
>>> -DTWITCH_CLIENTID=abc\`def
echo $'-DTWITCH_CLIENTID=\037abc`def\037'
>>> -DTWITCH_CLIENTID=abc`def

i.e., the thing I wanted to escape is not.

I also tried countless combinations of ' and ", trying to echo them alongside the variable, using echo and quote in various combinations and I’m just stuck.


I also went back to the very base, just bash…

echo '\'abc\`def\''
> ^C

echo '\'abc\`def\'';
> ^C

echo 'abc'
abc

echo 'abc\`def'
abc\`def

echo '\'abc\`def\''
> ^C

… it just enters a prompt, no wonder this isn’t working. Can anyone tell me why? :frowning:

Use double quotes in bash.
http://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
http://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html

As I said I tried that in various combinations but it didn’t take. Also per the documentation you linked:

Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’

Notice the second from last character it mentions, that was exactly my issue :wink: Needed a ' to use that literal value (which is what I found fairly early on, but took a while to work around the RPM macros removing the quotes, because who knows why…).

But you can just escape it with a backslash? The point is that you need double quotes to properly escape characters or else bash would use their syntactical meaning. Of course you never say the exact output you’re looking for so I’m presuming things here.

echo “abc\`def” <— The website made this a real bitch to type in formatted as a code line so it’s just plain text here

1 Like

Well that’s what I was thinking. The issue is/was that I can do that in the initial input, but what happens between my input into the terminal and when it actually hits cmake I have little control over. The issue was that those escape characters got stripped (which is good in a sense because I needed those literal ` in the cmake argument), and escaping multiple times (i.e. \\` didn’t work either. What I needed was for the cmake to end up like -DTWITCH_CLIENTID=‘abc`dec’, and that through multiple layers of that string getting passed on over which I have no control.

But double-quotes do not escape this exact character, as per the documentation you linked :wink: Single-quotes do (or rather, they take it as a literal character so it needs no escaping)

i just re-read it, you got it to work :D… dam my dyslexia…

No worries, only my wall has a hole now :slight_smile:

Looks like CMake automatically escapes backticks which I suppose is the source of the problems. Also no need for the sass, just trying to help since you did specifically ask why the bash wasn’t working.

https://cmake.org/cmake/help/latest/prop_dir/COMPILE_DEFINITIONS.html

Wasn’t sass, sorry if it came off like that :wink:

That bit about Cmake is interesting, but it doesn’t seem to work that way… my compiles failed when it was just -DTWITCH_CLIENTID=abc`def. Although how I understand that cmake documentation it only escapes it for the build system (i.e. make), so when passing it, it still needs to be at least in quotes (which was what I was struggling with), because when passing it to cmake we are still in bash land where ` was an issue

uh…huh…

Who wrote these Kernel Messages? :joy:

Message from syslogd@localhost at Apr 26 10:15:36 ...
 kernel:Uhhuh. NMI received for unknown reason 2d on CPU 11.

Message from syslogd@localhost at Apr 26 10:15:36 ...
 kernel:Do you have a strange power saving mode enabled?

Message from syslogd@localhost at Apr 26 10:15:36 ...
 kernel:Dazed and confused, but trying to continue

Message from syslogd@localhost at Apr 26 14:03:11 ...
 kernel:Uhhuh. NMI received for unknown reason 3c on CPU 11.

Message from syslogd@localhost at Apr 26 14:03:11 ...
 kernel:Do you have a strange power saving mode enabled?

Message from syslogd@localhost at Apr 26 14:03:11 ...
 kernel:Dazed and confused, but trying to continue

Not sure what this is supposed to tell me either, first time this appeared (as a notification no less) in over 2 years at this point… :joy:
I mean gamemode is active but that’s not exactly the first time…

edit: just got the second one (14:03 above), and its spewing this in both my open terminal windows O.o Never seen this and no idea what’s happening

2 Likes