LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-12-2011, 05:26 PM   #1
ashaquick
LQ Newbie
 
Registered: Aug 2007
Posts: 5

Rep: Reputation: 0
Scripts that run on SSH login


I have a small problem that has proven really frustrating to fix.

I work at the helpdesk of a supermarket chain. All the registers in all the stores are linux boxes, running a stripped down version of RedHat (7.3 I think). We have to log in to these registers multiple times a day when things go wrong.

When use SSH to log in, but every time we do there is a delay. There is a message that says "RTNETLINK answers: file exists" and a five second delay before the command prompt appears.

At first, I went looking for the cause of this message. I'm a complete linux newb, but what I gathered was that it was caused by something trying to add an entry into the network routing table that was already there. I don't even really know what that means. I've tried typing the "route" command, but it produces only the table column headings but no table entries.

I've run a ps -a during the delay, and it turned out to be a sleep process.

So I added a line into /etc/profile.local to kill sleep. But this script runs before whatever is causing the RTNETLINK message. I tested this by adding an echo command in.

So I guess my questions are:

What other scripts run automatically when you log in via SSH?

And does anyone have any clues about the RTNETLINK message?

Thanks.
 
Old 03-12-2011, 05:42 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Came across this:
http://www.linuxquestions.org/questi...-rhel5-710766/

Not sure if that would be related or not... Just to throw it out there.

Josh
 
Old 03-12-2011, 06:49 PM   #3
ashaquick
LQ Newbie
 
Registered: Aug 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by corp769 View Post
Came across this:
http://www.linuxquestions.org/questi...-rhel5-710766/

Not sure if that would be related or not... Just to throw it out there.

Josh
I've seen that before. That was what clued me in to what the problem might be, but my error is not the same. I can't recreate the "File exists" message by doing "ifup eth0" or anything. I don't know what's causing the RTNETLINK message.
 
Old 03-13-2011, 12:46 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
If you want to know what version of Linux you're using look at the file /etc/issue

As for what's being run when you log in there'll be shell configuration files and it's possible there's something being called in the PAM stack. Shell files will depend on what shell you're using and the version of Linux. The shell is probably bash. You can tell by typing

Code:
$ echo $0
If it's bash, then look at files like /etc/bash* and /etc/*profile to see if you can find a command that might be casing the message and delay.

See if you can recreate the problem message and delay by invoking a new instance of the shell. For example if you're using bash then type
Code:
$ bash
If that does create the message and delay then type
Code:
$ exit
to exit that instance of the shell. Then try running

Code:
$ strace bash
and you'll see what's being accessed/run. If the output goes past too quick then you can use the strace -o option to send the output to a file. Also using -t might be useful as it puts the time at the start of each line, which will help when you're trying to find the point in the file when the delay is happening.


Code:
$ strace -o straceoutput -t bash



To see if there's anything being called from the PAM stack look at the files which are probably in /etc/pam.d
 
  


Reply



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
How does linux know which scripts to run at login? bmn Linux - Newbie 4 07-30-2010 03:29 PM
How do I Run Login Scripts on OpenBSD 4.4? intermentals *BSD 6 02-01-2010 08:48 PM
[SSH]Which login scripts are run? jamesstanley Linux - Server 3 11-17-2007 06:24 AM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 10:59 AM

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

All times are GMT -5. The time now is 03:26 PM.

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
Open Source Consulting | Domain Registration