Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Where is startup file when SSH access to my account

Posted on 2013-12-18
9
Medium Priority
?
439 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 20

Accepted Solution

by:
simon3270 earned 2000 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 20

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 20

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 20

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to moveā€¦
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
Course of the Month10 days, 5 hours left to enroll

926 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