0

I see that this question has been posted and answered. However, the post answer does not work for me. The posted answer has 2 solutions:

1 - run bashdb as root

this does not work for me because the script I am trying to debug must be run as mqm.  This script exits when it sees that it is being run (via bashdb) as root.

2 - Add the user to the group listed by ls -l $(tty)

I ran this command and got:

mqm@localhost.localdomain(/var/mqm/scripts): ls -l $(tty) crw--w----. 1 root tty 136, 0 Jun 17 10:11 /dev/pts/0

 I ran (as root)  usermod -a -G root mqm  

and verified that the root group contains mqm - then logged in as mqm, I re-ran
bashdb myscript and again received this error /usr/share/bashdb/lib/setshow.sh: line 91: /dev/pts/0: Permission denied

rocky
  • 7,226
  • 3
  • 33
  • 74
J. Davis
  • 1
  • 1
  • Sorry for the post title. Stackoverflow complained about my initial title attempt because there was already a post with that title. This post is about bashdb error = /usr/share/bashdb/lib/setshow.sh: line 91: /dev/pts/0: Permission denied. It is not viable for me to try bashdb logged in as root and after adding mqm to the group (see above) I still get the permission error. – J. Davis Jun 18 '17 at 01:50

1 Answers1

0

Bashdb also has a --tty option.

By default, bashdb ... is the same as bashdb --tty $(tty). So try giving an explicit --tty argument with a name of a tty or psuedo tty that you know you can write to.

Here is how you might test having access to the tty before running bash. Suppose the tty is /dev/pts/2 then run

echo hi > /dev/pts/2

If that works, then try bashdb -tty /dev/pts/2 ...

rocky
  • 7,226
  • 3
  • 33
  • 74