byobu will not start after upgrade: Cannot exec 'motd+shell'

Bug #589715 reported by Steven Danna
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Medium
Unassigned
byobu (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

After upgrading to 2.78-0ubuntu1~ppa4 byobu immediate exits after starting and emitting the following error:

Cannot exec 'motd+shell': No such file or directory.

This only occurs when 'motd+shell' was the only window currently selected. This can be easily fixed by commenting out or removing the following line in .byobu/windows:

screen -t shell motd+shell

Or by uncommenting or adding a well-formed line to open a second window.

This does not cause a problem for those using a terminal emulator since they are left with a bash shell and can easily edit the file. However, if you have byobu set to launch at login you will immediate be logged out of your tty. Ideally, you would get thrown back to a shell so that you could fix the error.

Changed in byobu:
status: New → Fix Committed
importance: Undecided → Low
importance: Low → Medium
status: Fix Committed → Fix Released
Revision history for this message
Steven Danna (ssd7) wrote :

So symlinking motd+shell definitely fixes the issue on upgrade. However it wouldn't fix the following situation:

A user who uses a tty does the following:
1) Makes changes that have the effect of changing the contents of .byobu/windows to something similar to:

# Default windows examples
#screen -t notify-osd -M tail -f $HOME/.cache/notify-osd.log
#screen -t top top
#screen -t web elinks
#screen -t shell motd+shell
screen -t opps does_not_exist

2) User has launch on login check.
3) User logs out.
4) User logs in.
5) User is immediately logged out when does_not_exist fails to exec.

I'm not sure if there is really anything that can be done about this or if it is really a bug. I just thought I should mention it. I've tested this situation on my Ubuntu desktop, and am not sure how it would play out on ubuntu-server yet.

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 589715] Re: byobu will not start after upgrade: Cannot exec 'motd+shell'

Well, that would be unfortunate. It might occur if the user typo's
the line in the windows file.

I'd recommend something along the lines of:
 ssh <machine> rm -f ~/.byobu/windows

That does of course require ssh access.

Actually, this should already be fixed the current 2.79 release.

This now puts the following in ~/.profile:
`echo $- | grep -qs i` && byobu-launcher && exit 0

That "&& exit 0" should only exit if the byobu command succeeded. If
it exited non-zero, I think it should drop you to a command prompt.
Can you give that a shot?

Revision history for this message
Steven Danna (ssd7) wrote :

I'm still seeing the error with the following:

$ apt-cache policy byobu
byobu:
  Installed: 2.79-0ubuntu1~ppa4
  Candidate: 2.79-0ubuntu1~ppa4

$ cat .byobu/windows
# Default windows examples
#screen -t notify-osd -M tail -f $HOME/.cache/notify-osd.log
#screen -t top top
#screen -t web elinks
#screen -t shell motd+shell
screen -t shell /bin/does_not_exist

1) Switch to tty1 (Ctrl + Alt + F1)
2) Login
3) Get a message about the inability to exec
4) Screen terminates and I am logged out.

The problem is that byobu is exiting with 0.

This can be seen if you do the following from a terminal with the
errant .byobu/windows file:

$ byobu
(Unable to exec, screen terminates)
$echo $?
0

Similarly,

$ screen does_not_exist
(unable to exec, screen terminates)
$ echo $?
0

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

Hmm, I'm not sure what else we can do within byobu here.

Perhaps we need to patch screen to propagate the command-not-found
error message and exit code.

Revision history for this message
Steven Danna (ssd7) wrote :

I had a few minutes today and created a semi-solution here:

https://code.edge.launchpad.net/~ssd7/byobu/byobu-newwindow-check

It's not truly a solution, but it checks to ensure that the command given in the new window dialog is executable. At the very least this would prevent byobu-config from ever writing a .byobu/windows file that leads to this situation.

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

Thanks, Steven, I'll have a look.

Changed in byobu:
status: Fix Released → Triaged
Changed in byobu:
status: Triaged → In Progress
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Thanks, Steven.

I fixed the particular bug in the initial report. I did take a look at your branch (thanks!). I don't think that's quite the best solution, though (running of the command). We don't really know what that command is, or if the user *actually* wants to run it. It might be a really long, hard, difficult operation, or even something that is only supposed to be run once, or occasionally.

Anyway, hopefully the main issue (upgrading when motd+shell doesn't exist) is solved now, though :-)

Cheers,
:-Dustin

Changed in byobu:
status: In Progress → Fix Committed
Changed in byobu (Ubuntu):
status: New → Fix Committed
importance: Undecided → Medium
Changed in byobu:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
byobu (3.2-0ubuntu1) maverick; urgency=low

  * usr/share/byobu/keybindings/f-keys: resize the screen as part of the
    F5/refresh, LP: #619899
  * usr/bin/byobu-launcher: don't launch if in a dumb terminal, LP: #612886
  * usr/lib/byobu/network, usr/share/man/man1/byobu.1: allow for
    configuration of network traffic in [kM]ps, LP: #578377
  * configure.ac: POSIX sed doesn't include -i option, LP: #619328, #622640
  * usr/bin/byobu-janitor: improve dash replacement in status config,
    LP: #598488
  * usr/bin/byobu-janitor: fix upgrades where one's window list might have
    motd+shell, LP: #589715
 -- Dustin Kirkland <email address hidden> Mon, 23 Aug 2010 17:34:33 -0400

Changed in byobu (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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