Solved

Where is startup file when SSH access to my account

Posted on 2013-12-18
9
422 Views
Last Modified: 2013-12-18
Dear Experts,

I have re-installed perl package, and then logout and login my account again.
After logging with login and password through SSH shell access, it prompt
me some error such as
Can't locate local/lib.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 .).
BEGIN failed--compilation aborted.

that message is probably related to the old version of perl and path setup .

So I go to check my .bashrc script at my user account and root account , both files don't have any command related to perl. Where is such error perl command stored  so that  I can delete it and get rid of the error message or change the path to new version of perl.

So besides shell script, what is other linux startup files will run when user access account through SSH ?

And new version of perl is okay after check perl -v command

Please advise
Duncan


my .bashrc file at root or user account
==============
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

Open in new window

0
Comment
Question by:duncanb7
  • 5
  • 4
9 Comments
 
LVL 19

Accepted Solution

by:
simon3270 earned 500 total points
ID: 39726354
/etc/bashrc and /etc/profile, if present, will also get called.
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39726366
there is no such two directories  at root or user account after checking
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39726372
They're not account-specific - they are files called /etc/bashrc and /etc/profile which are called for all logins - I'd be surprised if they weren't there.

Which specific version of Linux are you using?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 13

Author Comment

by:duncanb7
ID: 39726401
Found it,  what is different between /etc/profile and /etc/bashrc ?

and what is different between .bashrc and /etc/bashrc ?
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39726477
//-sh script running in profile
=====================
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null 2>&1
        fi
    fi
done
//----------For  comment bashrc file------
if [ "$LOCALLIBUSER" != "root" ]; then
    eval $(perl -Mlocal::lib)
fi



in profile file, there is sh script running and  there is perl command saved in /profile.d/locallib.sh, just rename  it and
in bashrc, there is also perl command about perl -Mlocal::lib, just comment it
both is done and then the error message is removed.
0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 39726478
Thanks for your reply


Duncan
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39726479
If you start a login shell (e.g. when you log in, or if you run "su -"), /etc/profile is called, then it looks for .bash_profile .bash_login and .profile in that order, and sources the first one it finds .

If you start a non-login shell (e.g. you type "bash" at the shell prompt), .bashrc is called.  In your .bashrc, you can see that it in turn sources /etc/bashrc.

So, .bash_profile is the personal login profile file, and /etc/profile is the global one for all users.  Similarly .bashrc is per-user, and /etc/bashrc (if your .bashrc looks like it does here) is global.
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39726484
I see we crossed over!  Glad we sorted it out.

Simon
0
 
LVL 13

Author Comment

by:duncanb7
ID: 39726517
For my memo only , now the solution is  avoiding or get rid of  error message  coming out after login but it is needed to find out the root cause of  perl command error in other new thread in future if need


perl command:   perl -Mlocal::lib

errror message which is deleted after login by this thread solution:
Can't locate local/lib.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 .).
BEGIN failed--compilation aborted.

Duncan
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question