SSH agent not hooked up on first launch

Bug #528967 reported by Adam Collard
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Wishlist
Unassigned
byobu (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

$ byobu -v
byobu version 2.58
Screen version 4.00.03jw4 (FAU) 2-May-06

$ dpkg-query -W byobu screen
byobu 2.59-0ubuntu1
screen 4.0.3-14ubuntu1

When first launching byobu from gnome terminal (either via the automatically run at login option, or manually executing byobu), the SSH agent is not properly configured. In both cases, it is launching a new screen session

GNOME terminal:
$ ssh-add -l
[output listing fingerprints of keys etc.]
$ byobu
...
in-byobu $ ssh-add -l
Could not open a connection to your authentication agent
in-byobu $ exit

Then when I launch it again it works..

$ byobu
...
in-byobu $ ssh-add -l
[same expected output as above]

Related branches

Revision history for this message
Adam Collard (adam-collard) wrote :

Looks like the symlink is missing first time round:

in-byobu $ ls -al $SSH_AUTH_SOCK
ls: cannot access /var/run/screen/S-$USER/byobu.ssh-agent: No such file or directory

Confirmed that there's no symlink in there the first time, but is the second (and subsequent) times

Changed in byobu:
status: New → Fix Committed
importance: Undecided → Wishlist
assignee: nobody → Dustin Kirkland (kirkland)
Changed in byobu (Ubuntu):
status: New → Fix Committed
importance: Undecided → Wishlist
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 2.60-0ubuntu1

---------------
byobu (2.60-0ubuntu1) lucid; urgency=low

  [ Dustin Kirkland ]
  * usr/bin/byobu-export, usr/lib/byobu/ec2_cost,
    usr/share/byobu/ec2/rates.eu_ie, usr/share/byobu/ec2/rates.us_ca,
    usr/share/byobu/ec2/rates.us_va: LP: #531497
    - update ec2 pricing model, allow for local overrides of prices
      via a sourced symlink or bespoke file in $HOME/.byobu/ec2_rates
  * usr/bin/byobu: more completely support attaching to an existing ssh
    agent on first launch of byobu, LP: #528967
  * usr/share/man/man1/byobu.1: add manpage note about Mac OSX terminal
    setting, LP: #506576
  * debian/control: drop the screen-profiles-extras transitional package

  [ Meethune Bhowmick <email address hidden> ]
  * rpm/byobu.spec: specfile updated/modernized for current layout, LP: #526233
 -- Dustin Kirkland <email address hidden> Fri, 26 Feb 2010 10:43:00 -0600

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Adam Collard (adam-collard) wrote :

Sorry to say this is still happening.

$ byobu -v
byobu version 2.61
Screen version 4.00.03jw4 (FAU) 2-May-06

$ dpkg-query -W byobu screen
byobu 2.61-0ubuntu1
screen 4.0.3-14ubuntu1

Am happy to try some ideas out from a bzr branch and/or local hacks if that'll help

Changed in byobu (Ubuntu):
status: Fix Released → Confirmed
Changed in byobu:
status: Fix Committed → Confirmed
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

How would you normally do this outside of byobu, on first login?

I'm not really seeing the problem here, so I don't entirely understand it...

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

Oh, and the next time you can reproduce this, would you try running /usr/bin/byobu-janitor, and see if that hooks up your ssh agent?

Changed in byobu:
assignee: Dustin Kirkland (kirkland) → nobody
Changed in byobu (Ubuntu):
assignee: Dustin Kirkland (kirkland) → nobody
Changed in byobu:
status: Confirmed → Fix Released
Changed in byobu (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 2.67-0ubuntu1

---------------
byobu (2.67-0ubuntu1) lucid; urgency=low

  * Close LP: #528967, which was also fixed by the last upload
  * usr/bin/byobu-select-session: fix create-a-new-session on
    select-session dialog, LP: #550808
 -- Dustin Kirkland <email address hidden> Tue, 30 Mar 2010 00:56:18 -0500

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Neal McBurnett (nealmcb) wrote :

This was happening for me also in karmic. After getting 2.68-0ubuntu1~ppa4 from the ppa, I re-connected to my session and it worked like a charm.
Thanks, Dustin!

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 528967] Re: SSH agent not hooked up on first launch

Great, thanks for confirming, Neal!

Revision history for this message
Neal McBurnett (nealmcb) wrote :

Hmm - it did work that time, but has failed the next two times, right at startup.

$ ls -l $SSH_AUTH_SOCK
ls: cannot access /var/run/screen/S-neal/byobu.ssh-agent: No such file or directory

And byobu-janitor didn't help.

FWIW, outside of byobu my auth socket is this:

SSH_AUTH_SOCK=/tmp/keyring-i42fmr/socket.ssh

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

Neal-

When you encounter this, can you capture and attach the output of:
sh -x /usr/bin/byobu-janitor

Thanks!

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

Oh, and try:

. /usr/bin/byobu-reconnect-sockets

Revision history for this message
Neal McBurnett (nealmcb) wrote :

What does work for me is this manual symlink, based on the value of $SSH_AUTH_SOCK in a fresh Terminal:

 ln -s /tmp/keyring-i42fmr/socket.ssh $SSH_AUTH_SOCK

I took that symlink away again before doing the rest of what you suggest....

What puzzles me is why $SSH_AUTH_SOCK never seems to be set in the byobu code I've looked at, even though the proper symlinks are put in place. But the value for me has been changed to refer to /var/run/screen rather than /tmp/keyring, so it is being updated somewhere. But then that somewhere seems to not make the symlink....

It seems like the janitor will have trouble fixing this since the original socket path has been lost. Also, it gives up quickly without a --force:

$ sh -x /usr/bin/byobu-janitor
+ PKG=byobu
+ [ -r /etc/byobu/socketdir ]
+ . /etc/byobu/socketdir
+ SOCKETDIR=/var/run/screen
+ RUN=/var/run/screen/S-neal
+ FLAG=/var/run/screen/S-neal/byobu.reload-required
+ [ != --force ]
+ [ ! -e /var/run/screen/S-neal/byobu.reload-required ]
+ exit 0

I don't see any mention of $SSH_AUTH_SOCK in byoby-reconnect-sockets, but here goes:

$ . /usr/bin/byobu-reconnect-sockets
ls: cannot access /home/neal/.gnupg/gpg-agent-info-*: No such file or directory

Revision history for this message
Neal McBurnett (nealmcb) wrote :

Ahh - it took me a while to figure out what might have been obvious: byobu-janitor needs to be run from a fresh terminal which has the original value for $SSH_AUTH_SOCK. It also needs --force:

$ byobu-janitor --force

The range of configuration things it looks at is a bit scary, so I think I'll stick to the manual symlink I mentioned in my last post as a workaround for now.

Still not sure why the symlink isn't there after reboot/startup....

description: updated
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.