Solved

Where is startup file when SSH access to my account

Posted on 2013-12-18
9
428 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

737 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