Using ldapscripts within byobu

Bug #1094970 reported by Aritchie
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
byobu
Opinion
Low
Unassigned
tmux (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Ubuntu Server 12.04.1 LTS
byobu 5.22
tmux 1.6-1ubuntu1

When I run byobu on server console and then try to run say sudo ldapfinger username, I get the response:

Could not guess current user

Is this expected behaviour or shouldl it work with byobu. I get the same response with sudo lsldap. I have not tried the other ldapscripts.

Aritchie (aritchie)
summary: - byobu ldapscripts
+ Using ldapscripts within byobu
Revision history for this message
Aritchie (aritchie) wrote :

Okay, after doing some more investigating I have discovered this problem only exists when I run byobu with tmux as the backend. If I run it with screen as the backend then ldapfinger and lsldap work as expected.

Aritchie (aritchie)
description: updated
Revision history for this message
DaveQB (david-dward) wrote :

I also have this issue.

Revision history for this message
Aritchie (aritchie) wrote :

Apparently it only exhibits this behavior at the server console itself. When I use byobu in an terminal on 12.04 Desktop and ssh over to the server, it does not do this - the scripts work fine.

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Is there a difference between the environment in the two scenarios? Can you post `env` from the console, and over ssh?

Changed in byobu:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Aritchie (aritchie) wrote :

Hi Dustin, I did a pipe on env into text files. I did one for byobu-screen and one for byobu and compared the two. The only difference I noticed was with the TERM environment variable. For byobu-screen it is "TERM=screen-bce" and for byobu it is "TERM=screen".

Revision history for this message
Aritchie (aritchie) wrote :

Okay I decided to just do another pipe with env but without using sudo and it gives me more info. I will post two files. byobuS.txt for running it with screen as the backend and the other byobuT.txt with tmux as the backend.

Revision history for this message
Aritchie (aritchie) wrote :

Here is the other one.

Revision history for this message
Marko Mikulicic (mmikulicic) wrote :

I did a quick strace -f and noticed that it executes /usr/bin/logname. which is the one failing under tmux.

logname then opens /var/run/utmp and fails

Revision history for this message
Dustin Kirkland  (kirkland) wrote :
  • 1 Edit (11.3 KiB, text/plain)

I can confirm this, outside of Byobu, running tmux alone. logname works when run in a shell and in screen, but fails under tmux.

kirkland@x220:~$ logname
logname: no login name
kirkland@x220:~$ echo $?
1

Strace is attached.

Changed in byobu:
status: Incomplete → Confirmed
Changed in tmux (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Changed in byobu:
status: Confirmed → Opinion
Revision history for this message
graysky (graysky) wrote :

I know this is an old bug report but I believe that you need to add this line to your ~/.tmux.conf in order for logname to return a sane value:

set -g default-terminal "xterm"

Revision history for this message
Aritchie (aritchie) wrote :

Sorry it took this many months for me to get back on this but I tried putting that line in the ~/.tmux.conf file and it made no difference. It still produces the same output when I attempt to use ldapfinger on a user.

Revision history for this message
Aritchie (aritchie) wrote :

...or at least at the server console it does. I will see what happens from a remote session from the client workstation.

Revision history for this message
Aritchie (aritchie) wrote :

Putting that line in the ~/.tmux.conf file makes no difference at all under any circumstances.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.