Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old November 24th, 2002, 12:39 AM
ChrisF ChrisF is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: U.S. Mass
Posts: 95 ChrisF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problems With Path

Hey All,

Im having a bizzare problem that I'm hoping someone can give me some direction on what I should be looking for to correct it.

To best explain I'm going to use PERL, but I'm 99% sure this isn't a perl problem so please don't think this is off topic.

Linux - Freebsd..

OK, I have a job that I'm doing for a company (web based application), I need to run both web application and various command line scripts so I also have a SSH account to the machine.
Just for reference, the machine is at a large ISP and its a dedicated machine.

Here is the problem.

I requested a some perl modules to be installed, which they did AND they all work via the web without any problem.

If I come in via SSH, none of the perl modules are installed
(meaning the scripts can't locate the module when doing a USE or even checking via the command line with PERL -MCGI -e 0).

It doesn't matter if you are on the web or in via the command line the paths that perl is looking for this is always the same..

So for example lets say perl is looking for modules or whatever in

/usr/perl/modules

Via the web that is what is uses and works fine..
Via SSH it tells me it can't find the modules in that same location.

The problem is when I log in via SSH no matter where I am on the file system (even at the root) when I type PWD I see:

/usr/name/home

This isn't a symlink or anything like that - fact is I don't know what the heck but perl knows the proper path for the modules is /usr/perl/modules but when I'm logged in via SSH where those modules REALLY are is
/usr/name/home/usr/perl/modules

I know this is something to do with either how the account or SSH is setup, it can't be something with perl..

Any ideas?

Thanks
-Chris

Reply With Quote
  #2  
Old November 24th, 2002, 04:45 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
no, it´s nothing wrong with perl
your www server seems to run chroot´ed. that´s why it needs another path for the modules than when used locally.

for a "quick fix", try this:

ssh <your host>
cd /usr/name/home
chroot .

then you should have the same environment like your www server.
for leaving the chroot´ed environment, type "exit".
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old November 25th, 2002, 05:14 AM
ChrisF ChrisF is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: U.S. Mass
Posts: 95 ChrisF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the tip M - I tried this but all I get is:

prompt% chroot .
chroot: Command not found.
prompt% ./chroot .
./chroot: Command not found.

Then when I *find* chroot and try it..

matrix% /usr/sbin/chroot .
chroot: .: Operation not permitted

So is my only option to get on the ISP to correct this?

Thanks
-Chris

Reply With Quote
  #4  
Old November 25th, 2002, 05:20 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
the man page says nothing about needing root access for using chroot() but from testing, it seems like it does

so you probably need your ISP to do it for you (setup chroot for your ssh login too, maybe give you a second login for this purpose)

you say it is a dedicated machine. do you have root access?

[edit]
also the perl man page mentions a file called "@INC" to locate the perl libraries. but i don´t know if library==module
ask the perl gurus in the perl forum about how to setup another path for the modules depending if a program is run on the console opposed to via the web server.
[/edit]

Last edited by M.Hirsch : November 25th, 2002 at 05:24 AM.

Reply With Quote
  #5  
Old November 25th, 2002, 11:30 AM
ChrisF ChrisF is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: U.S. Mass
Posts: 95 ChrisF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I know, isn't it soo lame - these people pay for a dedicated machine and they are not allowed root access.

I would also think that with a dedicated machine there shouldn't be any need to have all this pre-pended path stuff for any shell login as there is (and will only ever be) a single SSH account.

So far I've been pretty unhappy with everything I've seen out there and I think i'm going to convince these people to move to my ISP where things like this isn't a issue.

I also just found out that I can't relay off their SMTP server which I also find pretty strange as I'm on a machine within their network, I've never seen a ISP that wouldn't let you relay internally (I'm not a huge fan of using sendmail)..

As for @INC, I know I could get all the path names, then add the path that is causing me problems but that just seems like doing a patch instead of fixing the real problem

And as for running "chroot", can't explain that either.. The permissions are fine for me to run it.

-r-xr-xr-x 1 root wheel 3988 Nov 6 2001 chroot

Yet I get that "Operation not permitted" - Is it me or are these guys not Aces when it comes to maintaining a linux server <g>..

Thanks
-Chris

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Problems With Path


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway