Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#32201 - /etc/motd displayed twice on login

Attached to Project: Arch Linux
Opened by David J. Haines (dhaines) - Wednesday, 24 October 2012, 16:54 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 17 November 2012, 15:14 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

On a login to the console /etc/motd is displayed twice instead of only once as expected. This is due to the fact that both login(1) and the pam_motd module show it with the Arch defaults provided.

This can be corrected either by removing the pam_motd line from /etc/pam.d/system-login (from pambase) or by adding a blank MOTD_FILE item to /etc/login.defs (from shadow). I would think that the former method would be preferable, as it's already a file wholly maintained by the Arch project (preference against "unnecessary patching," and all).
This task depends upon

Closed by  Dave Reisner (falconindy)
Saturday, 17 November 2012, 15:14 GMT
Reason for closing:  Fixed
Additional comments about closing:  shadow-4.1.5.1-2
Comment by Dave Reisner (falconindy) - Wednesday, 24 October 2012, 17:30 GMT
I don't follow. /etc/login.defs is an arch maintained file, and the default shipped file does not define MOTD_FILE. I verified login(1) and su(1) do not do anything if this isn't defined. So, the only thing that displays an motd is /etc/pam.d/system-login.
Comment by David J. Haines (dhaines) - Wednesday, 24 October 2012, 19:08 GMT
Did you try creating an /etc/motd and logging in through a text console? That's where it appears twice for me, once before the mail and lastlog lines, one right after. I just tested the same in a VirtualBox guest install, and I get the same result.

If it's not defined in /etc/login.defs, it defaults to showing /etc/motd, at least according to the manpage. It has to be explicitly set to nothing for login(1) not to display the motd. Running su(1) isn't equivalent to running login(1), but running "exec login [-f] username" as root will show the buggy behavior, at least from the console.

I realize that login.defs is Arch-maintained, but it's derived from the one that ships upstream with shadow. On the other hand, /etc/pam.d/system-login is wholly Arch-created, so to my mind, it makes more sense to make the changes there.
Comment by Dave Reisner (falconindy) - Wednesday, 24 October 2012, 19:33 GMT
login.defs isn't any more or less "derived from upstream" than pambase is. I'm far more inclined to fix this in login.defs since the problem is specific to login, not all users of /etc/pam.d/system-login.
Comment by David J. Haines (dhaines) - Wednesday, 24 October 2012, 19:35 GMT
Do as you think best. I'm just the reporter here.
Comment by Tobias Powalowski (tpowa) - Thursday, 25 October 2012, 12:36 GMT
you can also create <home>/.hushlogin to avoid this.

Loading...