Comments (14)
What happens if you comment out content of your .bashrc
and left only source /etc/nhi/nhi.bash
uncommented (and obviously restart your terminal/bash)?
does nhi works in that situation?
from nhi.
Same result : no output from nhi fetch {-1}
I tried something else:
Clone your repository
- Compile
nhi
with make - delete
/var/nhi/db
- and rerun
sudo -E bash ./install
Now I get
$ echo nhi test
nhi test
$ nhi fetch {-1}
no such shell session: 0
$
from nhi.
Before running install file again, you need to manually reverse changes made by install.
What you basically need to do is:
- stop and disable service by:
sudo systemctl stop nhid && sudo systemctl disable nhid
- delete all files created by install
- and remove
source /etc/nhi/nhi.bash
lines from.bashrc
(or/and.zshrc
)
(https://github.com/strang1ato/nhi/blob/main/install#L17)
Now rerun sudo -E bash ./install
(after following #16 (comment)) and restart you machine
from nhi.
Same error message : no such shell session: 0
(started from scratch, with ~/.bashrc
only containing the source /etc/nhi/nhi.bash
line)
from nhi.
Can you show me the content of /tmp/nhi.log
file (this file is created if error occurs, if it doesn't exist that's okay. You need root access to access that file).
and can you run this command and send me the output:
getent group tty
from nhi.
Hi, here is the output :
$ getent group tty
tty:x:5:brltty
$ echo nhi test
nhi test
$ nhi fetch {-1}
no such shell session: 0
$ getent group tty
tty:x:5:brltty
$ sudo ls -l /tmp/nhi.log
-rw----r-T 1 root root 424 19 déc. 22:15 /tmp/nhi.log
sudo cat /tmp/nhi.log
2021-12-19 22:14:55 | process_vm_readv failed at get_shell_environ
2021-12-19 22:14:55 | no such table: 0
2021-12-19 22:15:13 | process_vm_readv failed at get_shell_environ
2021-12-19 22:15:13 | no such table: 0
2021-12-19 22:15:24 | process_vm_readv failed at get_shell_environ
2021-12-19 22:15:24 | no such table: 0
2021-12-19 22:15:27 | process_vm_readv failed at get_shell_environ
2021-12-19 22:15:27 | no such table: 0
2021-12-19 22:15:57 | process_vm_readv failed at get_shell_environ
2021-12-19 22:15:57 | no such table: 0
$
I ran these command inside the Kitty terminal I currently use, but got same output when run inside a gnome-terminal.
Also I ran these commands with a ~/.bashrc
containing only the nhi.bash
line, and after removing/reinstalling nhi
and rebooting.
from nhi.
Can you run this command and send here the output:
objdump -T $(which bash) | awk -v sym=environ ' $NF == sym && $4 == ".bss" { print $1; exit }'
from nhi.
Sure, here it is :
$ objdump -T $(which bash) | awk -v sym=environ ' $NF == sym && $4 == ".bss" { print $1; exit }'
00000000000e92e0
$
from nhi.
What's your kernel version? and are you sure that all deps are installed?
from nhi.
Hmm, some additional infos from my system, which I maintain uptodate very frequently (every week or so)
$ cat /proc/version
Linux version 5.15.10-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Fri, 17 Dec 2021 11:17:37 +0000
$
Is there any dependency I could check which is not listed below ?
(Arch packages may be different than those of Debian family).
$ LANG=C sudo pacman -Q binutils gawk sqlite3 libsqlite3-dev libbpf libbpf-dev
binutils 2.36.1-3
gawk 5.1.1-1
sqlite 3.37.0-1
error: package 'libsqlite3-dev' was not found
libbpf 0.6.0-1
error: package 'libbpf-dev' was not found
$
binutils
containsobjdump
- According to ROS,
sqlite
package contains dev version
As for libbpf-dev
, I don't know, could it be the culprit ?
from nhi.
@hutou
On my arch device nhi works fine without any issues, I think that I might need to install nhi on fresh and mininimal arch install.
I will let you know whether I can replicate your issue.
from nhi.
@hutou
Can you follow these steps: #13 (comment), and check whether nhi works after reboot
from nhi.
Finally, nhi
works on my computer, but ... I could not identify the precise reason why it did not work after the first installation, because I made many manipulations, installations and reinstallations without results before suddenly noticing that it worked!
Maybe the result of a system update?
In any case, I found that the installation of the lib32-sqlite package is not necessary for an Archlinux install.
Moreover, to answer my need for command history management (see post 1), in the /etc/nhi/nhi.bash
file, I modified the line
declare PROMPT_COMMAND="prompter"
by
declare PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND}; prompter"
(and also to keep other programs using PROMPT_COMMAND
working, like autojump
.
Another suggestion : add "current" after the session Id when appropriate for nhi log
command
Thanks for this very usefull utility.
from nhi.
Moreover, to answer my need for command history management (see post 1), in the /etc/nhi/nhi.bash file, I modified the line
declare PROMPT_COMMAND="prompter"
by
declare PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND}; prompter"
(and also to keep other programs using PROMPT_COMMAND working, like autojump .
I will try to add it in the next release
Another suggestion : add "current" after the session Id when appropriate for nhi log command
Thanks for suggestion, I will try to address that as well (although probably in some other time)
from nhi.
Related Issues (19)
- [lib] nhi doesn't save bash errors to db HOT 1
- Add support for different init systems
- bash + gnome terminal disturb saving of complex apt outputs
- `nhi` doesn't record commands HOT 18
- Make nhi available via package manager HOT 8
- `nhid` segfaults on 0.2.2 while using tmux HOT 1
- Support fish shell HOT 1
- Is there any way to make this work on Ubuntu 20.04? HOT 3
- Output of commands not saved when vim is ran HOT 4
- libbpf: elf: legacy map definitions in 'maps' section are not supported by libbpf v1.0+ HOT 1
- Move to BPF magic HOT 1
- [BPF] Improve safety of potentially concurrent calls HOT 1
- Add full support for rxvt based terminals
- Add full support to all builtins
- Create basic config file
- Save owner of shell and commands executed
- Keep record of CPU and memory activity of a process
- [bpf] Move as much functions as possible to tracepoints from fentry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nhi.