Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-12-2011, 06:26 PM   #1
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?

Old 03-12-2011, 06:42 PM   #2
LQ Guru
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Came across this:

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

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

Original Poster
Rep: Reputation: 0
Originally Posted by corp769 View Post
Came across this:

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

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, 01:46 PM   #4
Senior Member
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
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

$ 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
$ bash
If that does create the message and delay then type
$ exit
to exit that instance of the shell. Then try running

$ 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.

$ 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


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

All times are GMT -5. The time now is 06:36 AM.

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