LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-04-2005, 10:25 AM   #1
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Rep: Reputation: 31
motd appears twice


When i login motd file apears twice
Anyway how to trace that?
What configuration mistake can cause this behavior?
 
Old 12-04-2005, 10:46 AM   #2
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
One possibility is that motd is run from /etc/profile and .profile in your home directory. Compare the content of both files and see if either of them calls motd. You should also look at .bashrc and .bash_profile if they exist.
 
Old 12-04-2005, 11:52 AM   #3
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Original Poster
Rep: Reputation: 31
Quote:
cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
fi

if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

export PATH

umask 022

cat ~/.profile
# ~/.profile: executed by Bourne-compatible login shells.

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
export PATH

mesg n

cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.

export PS1='\h:\w\$ '
umask 022

export JDK_HOME=/usr/local/lib/jdk
export CLASSPATH=$JDK_HOME
export PATH="$PATH:${JDK_HOME}/bin:${JDK_HOME}/jre/bin"

# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval `dircolors`
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias ll='ls -la'
alias rm='rm -i'
alias vi='vim'
alias r='route -n'
#alias r0='route -n | grep wlan0'
#alias r1='route -n | grep wlan1'
#alias r2='route -n | grep wlan2'
#alias r3='route -n | grep wlan3'
alias ld='ll -d'
alias down='ifconfig wlan0 down && ifconfig wlan1 down && ifconfig wlan2 down'
.bash_profile exists only in /etc/skel

no reference to motd
 
Old 12-04-2005, 12:33 PM   #4
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
OK, I was shooting from the hip and missed. I've looked at motd's man page now, and I see that /etc/motd is displayed by login "after a successful login but just before it executes the login shell."

What do you get when you do a `cat /etc/motd`? It is possible that the file carries the same message twice. (Hey, it could happen...)

What happens when you put a zero-length file called .hushlogin in your login directory? (In your home directory, do a `touch .hushlogin`.)
 
Old 12-04-2005, 12:49 PM   #5
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by hussar
What do you get when you do a `cat /etc/motd`? It is possible that the file carries the same message twice. (Hey, it could happen...)
nah - isnt so easy

Quote:
Originally Posted by hussar
What happens when you put a zero-length file called .hushlogin in your login directory? (In your home directory, do a `touch .hushlogin`.)
i dont see the motd (0 times)
 
Old 12-04-2005, 01:12 PM   #6
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
Hey, it was worth a shot.

It seems to me there are two other possibilities. Login is reading /etc/motd twice, or login is being run twice.

Either way, I'm stumped. I will be interested to see what answer you find.
 
Old 12-04-2005, 02:52 PM   #7
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Hmm, what happens if you do a "grep -r motd /*" or something along those lines to see if there's a config or startup file somewhere that might be calling it. I assume if that existed it would be in one of the places you've already looked, but it's always worth a shot to double-check everywhere.
 
Old 12-04-2005, 03:16 PM   #8
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Original Poster
Rep: Reputation: 31
Quote:
skilla:/etc# grep "/etc/motd" * -R3 |more
grep: alternatives/java: No such file or directory
default/rcS-UTC=no
default/rcS-# Set VERBOSE to "no" if you would like a more quiet bootup.
default/rcS-VERBOSE=yes
default/rcS:# Set EDITMOTD to "no" if you don't want /etc/motd to be editted automatically
default/rcS-EDITMOTD=yes
default/rcS-# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
default/rcS-FSCKFIX=no
--
init.d/bootmisc.sh- fi
init.d/bootmisc.sh-
init.d/bootmisc.sh- #
init.d/bootmisc.sh: # Update /etc/motd. If it's a symbolic link, do the actual work
init.d/bootmisc.sh- # in the directory the link points to.
init.d/bootmisc.sh- #
init.d/bootmisc.sh- if [ "$EDITMOTD" != no ]
init.d/bootmisc.sh- then
init.d/bootmisc.sh: MOTD="`readlink -f /etc/motd || :`"
init.d/bootmisc.sh- if [ "$MOTD" != "" ]
init.d/bootmisc.sh- then
init.d/bootmisc.sh- uname -a > $MOTD.tmp
grep: mail/smrsh/mail.local: No such file or directory
--
rcS.d/S55bootmisc.sh- fi
rcS.d/S55bootmisc.sh-
rcS.d/S55bootmisc.sh- #
rcS.d/S55bootmisc.sh: # Update /etc/motd. If it's a symbolic link, do the actual work
rcS.d/S55bootmisc.sh- # in the directory the link points to.
rcS.d/S55bootmisc.sh- #
rcS.d/S55bootmisc.sh- if [ "$EDITMOTD" != no ]
rcS.d/S55bootmisc.sh- then
rcS.d/S55bootmisc.sh: MOTD="`readlink -f /etc/motd || :`"
rcS.d/S55bootmisc.sh- if [ "$MOTD" != "" ]
rcS.d/S55bootmisc.sh- then
rcS.d/S55bootmisc.sh- uname -a > $MOTD.tmp
grep: rcS.d/S35devpts.sh: No such file or directory
nothing interesting until here

now:
Quote:
skilla:/etc# grep "motd" * -R3 |more
grep: alternatives/java: No such file or directory
default/rcS-UTC=no
default/rcS-# Set VERBOSE to "no" if you would like a more quiet bootup.
default/rcS-VERBOSE=yes
default/rcS:# Set EDITMOTD to "no" if you don't want /etc/motd to be editted automatically
default/rcS-EDITMOTD=yes
default/rcS-# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
default/rcS-FSCKFIX=no
--
init.d/bootmisc.sh- fi
init.d/bootmisc.sh-
init.d/bootmisc.sh- #
init.d/bootmisc.sh: # Update /etc/motd. If it's a symbolic link, do the actual work
init.d/bootmisc.sh- # in the directory the link points to.
init.d/bootmisc.sh- #
init.d/bootmisc.sh- if [ "$EDITMOTD" != no ]
init.d/bootmisc.sh- then
init.d/bootmisc.sh: MOTD="`readlink -f /etc/motd || :`"
init.d/bootmisc.sh- if [ "$MOTD" != "" ]
init.d/bootmisc.sh- then
init.d/bootmisc.sh- uname -a > $MOTD.tmp
grep: mail/smrsh/mail.local: No such file or directory
--
pam.d/ssh-@include common-session
pam.d/ssh-
pam.d/ssh-# Print the message of the day upon successful login.
pam.d/ssh:session optional pam_motd.so # [1]
pam.d/ssh-
pam.d/ssh-# Print the status of the user's mailbox upon successful login.
pam.d/ssh-session optional pam_mail.so standard noenv # [1]
--
pam.d/login-# (Replaces the `LASTLOG_ENAB' option from login.defs)
pam.d/login-session optional pam_lastlog.so
pam.d/login-
pam.d/login:# Prints the motd upon succesful login
pam.d/login-# (Replaces the `MOTD_FILE' option in login.defs)
pam.d/login:session optional pam_motd.so
pam.d/login-
pam.d/login-# Prints the status of the user's mailbox upon succesful login
pam.d/login-# (Replaces the `MAIL_CHECK_ENAB' option from login.defs).

--
rcS.d/S55bootmisc.sh- fi
rcS.d/S55bootmisc.sh-
rcS.d/S55bootmisc.sh- #
rcS.d/S55bootmisc.sh: # Update /etc/motd. If it's a symbolic link, do the actual work
--More--grep: rcS.d/S35devpts.sh: No such file or directory
rcS.d/S55bootmisc.sh- # in the directory the link points to.
rcS.d/S55bootmisc.sh- #
rcS.d/S55bootmisc.sh- if [ "$EDITMOTD" != no ]
rcS.d/S55bootmisc.sh- then
rcS.d/S55bootmisc.sh: MOTD="`readlink -f /etc/motd || :`"
rcS.d/S55bootmisc.sh- if [ "$MOTD" != "" ]
rcS.d/S55bootmisc.sh- then
rcS.d/S55bootmisc.sh- uname -a > $MOTD.tmp
The problem must be to italics letters
How can i restart login service / pam.d or something to apply changes to these files?
 
Old 12-04-2005, 03:31 PM   #9
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
I'd say comment out one of those sections and restart, but I don't know what pam is so I'll let someone else give a more informed comment.
 
Old 12-04-2005, 03:48 PM   #10
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Original Poster
Rep: Reputation: 31
pam is a sum of libraries that set the way a user will login/authenticate to the system.

any other way to restart the service without rebooting?
(i dont want to restart! uptime is bliss )
 
Old 12-04-2005, 03:55 PM   #11
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
You could look for the process (if it works that way) and kill and restart it, or try all the varieties of "foo/pam.d start/stop"
 
Old 12-04-2005, 06:13 PM   #12
JJX
Member
 
Registered: Mar 2004
Location: Greece
Distribution: Debian
Posts: 345

Original Poster
Rep: Reputation: 31
I marked as remark (nice expression :>)
in /etc/pam.d/ssh

# Print the message of the day upon successful login.
#session optional pam_motd.so # [1]

I restarted the service using
"/etc/init.d/inetd restart"

now everything works fine!
thx a lot
 
Old 12-04-2005, 06:24 PM   #13
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
I was close

Glad you got it fixed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/motd skate Linux - Software 5 05-03-2006 09:44 AM
Motd wizex Slackware 6 09-05-2005 09:27 AM
motd iomari Linux - Software 5 04-03-2005 05:43 AM
motd Master Fox Linux - Software 2 08-25-2004 08:40 AM
Is there any MOTD software available besides /etc/motd? csif Linux - Software 1 04-24-2004 07:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration