Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash preexec hack causes unnecessary debugger triggering #58

Open
yunake opened this issue Jan 16, 2019 · 1 comment
Open

bash preexec hack causes unnecessary debugger triggering #58

yunake opened this issue Jan 16, 2019 · 1 comment

Comments

@yunake
Copy link

yunake commented Jan 16, 2019

With UDM installed, running a shell script interactively causes debugger traps to activate for any non-zero exit status inside the script. This will either spawn a bashdb session, or if it's not installed it will complain about it missing like so:

yunake@core:~$ xrandr-current-output
/home/yunake/bin/xrandr-current-output: /usr/share/bashdb/bashdb-main.inc: No such file or directory
/home/yunake/bin/xrandr-current-output: warning: cannot start debugger; debugging mode disabled
DP1
yunake@core:~$ 

Of course, having the debugger installed is even worse since it means the script will drop into interactive debugging session and fail to complete.

I don't know how to fix this properly — I don't see a way to implement pre-exec hack in such a way that doesn't trigger debugger as a side effect.

As a work-around, one can simply create empty debugger hook file, this will suppress the messages:

mkdir /usr/share/bashdb
touch /usr/share/bashdb/bashdb-main.inc
@linnabraham
Copy link

bash: preexec_set_exit: command not found
I get this error when becoming root using su.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants