byobu-shell motd issue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
byobu |
Fix Released
|
Medium
|
Dustin Kirkland |
Bug Description
Having just installed a Ubuntu 14.04 LTS machine and enabled byobu I noticed that the motd doesn't display when you log in. On investigation this looks to be an out of date line in the byobu-shell script.
Line 27 reads:
[ -r /etc/motd ] && cat /etc/motd
to check if you can read the motd file and display it if you can. With current versions of Ubuntu this file is no longer used. Looking at my 14.04 install /run/motd.dynamic is the relevant file, and on my 12.04 server it looks to be /run/motd. I've not looked at what it may be on other versions of Linux that use byobu.
On the basis of these 3 potential locations a fix along the lines of:
if [ -f /run/motd.dynamic ]
then
[ -r /run/motd.dynamic ] && cat /run/motd.dynamic
elif [ -f /run/motd ]
then
[ -r /run/motd] && cat /run/motd
elif [ -f /etc/motd]
then
[ -r /etc/motd] && cat /etc/motd
fi
should do the trick in a reasonably generic fashion, although there may be a tidier way. I did experiment with:
[ -r /run/motd.dynamic ] && cat /run/motd.dynamic
[ -r /run/motd] && cat /run/motd
[ -r /etc/motd] && cat /etc/motd
but got the following lines printed as well as the motd:
/usr/bin/
/usr/bin/
I'm not entirely sure why there is no similar error with the default script when there is no /etc/motd file, I'm assuming it is suppressed/hidden since there is noting cat'd to the display.
Related branches
Changed in byobu: | |
importance: | Undecided → Medium |
status: | New → Triaged |
status: | Triaged → In Progress |
assignee: | nobody → Dustin Kirkland (kirkland) |
Changed in byobu: | |
status: | Fix Committed → Fix Released |
bzr commit -m '* usr/bin/ byobu-shell. in: LP: #1458941 media/src/ byobu/byobu/ byobu-shell. in
- find the motd' --fixes 'lp:1458941'
Committing to: /local/
modified debian/changelog
modified usr/bin/
Committed revision 2422.