Solved

Where is startup file when SSH access to my account

Posted on 2013-12-18
9
414 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now