LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux
User Name
Password
Bedrock Linux This forum is for the discussion of Bedrock Linux.

Notices


Reply
  Search this Thread
Old 10-20-2019, 01:08 PM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 134

Rep: Reputation: 188Reputation: 188
bedrock man command error


bedrock. running bash from the devuan strata while booted in the devuan strata's init. man is installed.

Observe the following session
Code:
bob@moonshadow:~ $ man man
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`.  To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $ which strace
/usr/bin/strace
bob@moonshadow:~ $ brl which strace
devuan
bob@moonshadow:~ $ which gdb
/bedrock/cross/pin/bin/gdb
bob@moonshadow:~ $ brl which gdb
devuan
bob@moonshadow:~ $ brl list
arch
bedrock
devuan
bob@moonshadow:~ $ # booted off devuan, using devuan bash
bob@moonshadow:~ $ strat devuan man man
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`.  To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $
Root has the same problem.

I have no idea what is going on. Can someone explain?

Thank you.
 
Old 10-21-2019, 05:58 AM   #2
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
When you run `man man`, `strat` is being called under-the-hood. This is probably because your shell is from a different stratum than either `man` or something else called indirectly such as (per the error message) `sed` or `less`. This is normal.

When `strat` is called it performs a sanity check it, and in this instance it sees something is wrong. The specific issue it is running into usually happens when users try to ptrace across a strat call, which Linux disallows with normal user permissions. This is why you get that error message. However, you're clearly not calling a ptrace related command like strace or gdb. Off the top of my head I have no idea why that's happening.

In general you should try `strat -r` to debug issues like this. My bet is `strat -r devuan man man` won't produce this specific error message, but might show some missing dependency of your `man` setup.

However, the specific error message you're getting is very strange and we should debug that irrelevant of what how `strat -r` changes things. Try running:

Code:
strat devuan strace -tvf -s999 -o/tmp/log man man
Then provide the contents of /tmp/log.

Last edited by ParadigmComplex; 10-21-2019 at 07:39 AM.
 
Old 10-21-2019, 05:25 PM   #3
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 134

Rep: Reputation: 188Reputation: 188
Well, I feel like a dope for not trying the "-r" option with strat, because that clearly indicated what was going on:
Code:
bob@moonshadow:~ $ strat -r devuan man man
man: can't execute less: No such file or directory
man: command exited with status 255: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $ which less
/bedrock/cross/bin/less
bob@moonshadow:~ $ brl which less
arch
bob@moonshadow:~ $
The fetch of the Devuan had never put the less package in. Oh.

Installed less. Ran "man man". No error, and the page displayed as was proper. This would indicate that maybe the devuan fetch should add the less package?

Maybe.

Then a dim memory came to the surface of my mind. I'd copied my .bashrc from my regular system. I took a look through it and found these two lines of interest:
Code:
export MANPAGER='less -X'
export PAGER='less -X'
So, I then removed the less package, took those lines out of my .bashrc, logged out & in, then typed "man man" again. Bam, Worked fine.

edit: I did also run your second command. the output was 3k, which is probably too large to fit in a post? In view of what I've shown, you probably don't need it now?

edit 2: my understanding is that this is a situation of one binary calling another, not a library call, and that bedrock usually handles this. So even though i had man calling a program (less) that does not exist, should it have just quietly ran the less that is in the other strata?

Last edited by jr_bob_dobbs; 10-21-2019 at 05:30 PM.
 
Old 10-21-2019, 05:49 PM   #4
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
If you had another less executable, it should have just transparently used that. If you didn't, it should have given a proper error about not being able to find `less`. Neither of these explain you getting this error:

Quote:
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`. To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
And so I'm still interested in the strace output I previously requested. Make sure to produce it where `less` isn't installed and those variables exist and you see the above error message.
 
Old 10-21-2019, 07:16 PM   #5
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 134

Rep: Reputation: 188Reputation: 188
I've still got the log from before, which is under the conditions you'd stated, but, as I'd feared, it's too big: the forum software is refusing.

btw, did you want that log from a run as root as or a user? I saved both.
 
Old 10-21-2019, 07:41 PM   #6
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
Maybe try gzip'ing it and adding it as an attachment. Or use some third party service like pastebin/bay/gist/etc.

Lets try non-root first.
 
Old 10-22-2019, 08:49 AM   #7
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 134

Rep: Reputation: 188Reputation: 188
As per your idea in irc:
Code:
bob@moonshadow:~ $ man man
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`.  To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $ /bedrock/bin/strat --arg0 less arch /usr/bin/less -X
Missing filename ("less --help" for help)
bob@moonshadow:~ $ /bedrock/bin/strat --arg0 less arch /usr/bin/less -X test.txt
Designed to be a small text file, so that one can see errors before.
bob@moonshadow:~ $ strat -r arch less
Missing filename ("less --help" for help)
bob@moonshadow:~ $  less
Missing filename ("less --help" for help)
bob@moonshadow:~ $ strat -r arch man man
strat: could not run
    man
from stratum
    arch
due to: unable to find file (ENOENT)
bob@moonshadow:~ $
 
Old 10-22-2019, 09:42 AM   #8
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
Lets try:

Code:
$ brl which /bedrock/cross/bin/less
$ echo "test" | strat devuan /bedrock/cross/bin/less -X
Also install libcap2-bin in devuan and run:

Code:
$ strat devuan getcap /bedrock/bin/strat
 
1 members found this post helpful.
Old 10-22-2019, 05:39 PM   #9
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 134

Rep: Reputation: 188Reputation: 188
OK:
Code:
bob@moonshadow:~ $ brl which /bedrock/cross/bin/less
arch
bob@moonshadow:~ $ echo "test" | strat devuan /bedrock/cross/bin/less -X
test
bob@moonshadow:~ $
Code:
root@moonshadow:~ # apt-get install libcap2-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcap2-bin is already the newest version (1:2.25-2).
libcap2-bin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@moonshadow:~ #
Code:
bob@moonshadow:~ $ strat devuan getcap /bedrock/bin/strat
/bedrock/bin/strat = cap_sys_chroot+ep
bob@moonshadow:~ $
Code:
root@moonshadow:~ # strat devuan getcap /bedrock/bin/strat
/bedrock/bin/strat = cap_sys_chroot+ep
root@moonshadow:~ #
I hope this helps.
 
Old 10-22-2019, 06:42 PM   #10
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
I'm out of ideas to debug this remotely. It's extremely strange. I couldn't reproduce it myself.

For the time being install less in Devuan as well as whatever other dependencies `strat -r devuan man man` makes clear are needed.

If it happens again in another context feel free to bring it to my attention. Maybe there'll be a pattern with the new context I can work from.
 
Old 10-22-2019, 08:05 PM   #11
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 134

Rep: Reputation: 188Reputation: 188
Understood. Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bedrock: bedrock poki remains on UTC no matter what jr_bob_dobbs Bedrock Linux 5 09-03-2019 05:10 AM
[SOLVED] bedrock not using brsh.conf, dropped to bedrock's /bin/sh Siljrath Linux - Distributions 2 08-25-2014 05:47 AM
[SOLVED] No audio for user in bedrock with sid & gentoo Siljrath Linux - Desktop 1 06-16-2014 01:44 PM
[SOLVED] man pages - man command phillyfilly Linux - Newbie 4 02-10-2014 05:41 AM
LXer: Google-Bedrock-Red Hat Indulge in Mud-Slinging Now LXer Syndicated Linux News 0 04-23-2011 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux

All times are GMT -5. The time now is 09:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration