Linux users, need your help.

notfred

Lifer
Feb 12, 2001
38,241
4
0
Ok, I replaced an RPM package with a newer version of the same app, complied from source. The app works fine if you use the full path, but if you jsut use the executable name, it only looks in one directory and fails to find it. See below:

[root@host directory]# echo $PATH
/usr/local/sbin:usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin

[root@host directory]# find / -name mogrify
/usr/local/bin/mogrify

[root@host directory]# mogrify
bash: /usr/X11R6/bin/mogrify: No such file or directory


Why won't it find my file?

it runs if I do "/usr/local/bin/mogrify" but not if I just do "mogrify"... WTH?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
for a bunch of computer nerds, you guys sure suck at helping with computer problems...
 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
Originally posted by: notfred
for a bunch of computer nerds, you guys sure suck at helping with computer problems...
You need to root the usr/local/bin/mogrify and map DIRECTLY to the /usr/local/sbin:usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin


 

Mutilator

Diamond Member
Aug 22, 2000
3,513
10
81
Originally posted by: Skoorb
Originally posted by: notfred
for a bunch of computer nerds, you guys sure suck at helping with computer problems...
You need to root the usr/local/bin/mogrify and map DIRECTLY to the /usr/local/sbin:usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin
Or just try posting in the right forum.
(Operating Systems)
;)


 

manly

Lifer
Jan 25, 2000
12,553
3,373
136
Originally posted by: Skoorb
Originally posted by: notfred
for a bunch of computer nerds, you guys sure suck at helping with computer problems...
You need to root the usr/local/bin/mogrify and map DIRECTLY to the /usr/local/sbin:usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin
I'm pretty sure you gave the correct answer, but I'll rephrase:

Luser error:
usr/local/bin
That's a relative path/typo. J/K notfred. :)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: wyvrn
edit:

NM try this:

./mogrify

Its in /usr/local/bin/ not ~/ which is where he probably is.

The relative vs full path is most likely the problem, or a typo. Either way this is the wrong forum.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: wyvrn
Check permissions of file:

ls-l /usr/local/bin/mogrify

You need execute permissions. If you don't have it, try:

chmod 744 /usr/local/bin/mogrify

and see if that works. I think it has to do with default permissions on newly created files not receiving the execute permission.

It's already set as executable. Anyway, it runs if I provide the full path, so permissions weren't a problem.

Skoorb: what are you smoking?
 

manly

Lifer
Jan 25, 2000
12,553
3,373
136
notfred,

Since I maybe wasn't clear enough, notice no initial slash in usr/local/bin in your PATH. That's what the problem is, and I sorta suspected Skoorb saw that as well, but his explanation sure is unconventional. And I think mine was a little terse.
 

wyvrn

Lifer
Feb 15, 2000
10,074
0
0
Change your $PATH, I believe you are missing the leading / for /usr/local/bin. Instead you have :usr/local/bin:

See if that works.

edit: doh they beat me too it!

Originally posted by: notfred
Ok, I replaced an RPM package with a newer version of the same app, complied from source. The app works fine if you use the full path, but if you jsut use the executable name, it only looks in one directory and fails to find it. See below:

[root@host directory]# echo $PATH
/usr/local/sbin:usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin

[root@host directory]# find / -name mogrify
/usr/local/bin/mogrify

[root@host directory]# mogrify
bash: /usr/X11R6/bin/mogrify: No such file or directory


Why won't it find my file?

it runs if I do "/usr/local/bin/mogrify" but not if I just do "mogrify"... WTH?

 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: notfred
Originally posted by: wyvrn
Check permissions of file:

ls-l /usr/local/bin/mogrify

You need execute permissions. If you don't have it, try:

chmod 744 /usr/local/bin/mogrify

and see if that works. I think it has to do with default permissions on newly created files not receiving the execute permission.

It's already set as executable. Anyway, it runs if I provide the full path, so permissions weren't a problem.

Skoorb: what are you smoking?


To quote from the original post:
[root@host directory]# echo $PATH
/usr/local/sbin:usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin

I bolded the part that may be the problem. Notice there is no / at the beginning. That would equate to ./usr/local/bin, which would work if you were in the / (root dir), but not if you were in say ~/ (home/notfred). If you changed it to

[root@host directory]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/usr/X11R6/bin:/root/bin


It should work. Of course, this may be have been a typo and not an actual part of the problem.
 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
Originally posted by: manly
notfred,

Since I maybe wasn't clear enough, notice no initial slash in usr/local/bin in your PATH. That's what the problem is, and I sorta suspected Skoorb saw that as well, but his explanation sure is unconventional. And I think mine was a little terse.
Hehe, I've never used Linux in my life. I have an overactive imagination :D

 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: wyvrn
Suprising amount of Linux users on anandtech, woowoo :)

Actually, I dont use linux right now. Havent in over a month (since I lost my job). Dont plan on it anytime in the near future. Im not a big fan of linux. :p
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Skoorb
Originally posted by: manly
notfred,

Since I maybe wasn't clear enough, notice no initial slash in usr/local/bin in your PATH. That's what the problem is, and I sorta suspected Skoorb saw that as well, but his explanation sure is unconventional. And I think mine was a little terse.
Hehe, I've never used Linux in my life. I have an overactive imagination :D

The funny part isn't that you made up some gibberish and tried to pass it off as advice. The funny part is that manly actually thinks it's correct!

Anyway, my path is fine, the missing / is a typo. I was running through VNC, which doesn't allow me to copy and paste to the windows clipboard, so I had to type it by hand. The actual path is /usr/local/bin
 

manly

Lifer
Jan 25, 2000
12,553
3,373
136
Originally posted by: Skoorb
Originally posted by: manly
notfred,

Since I maybe wasn't clear enough, notice no initial slash in usr/local/bin in your PATH. That's what the problem is, and I sorta suspected Skoorb saw that as well, but his explanation sure is unconventional. And I think mine was a little terse.
Hehe, I've never used Linux in my life. I have an overactive imagination :D
Call me gullible, but an uncareful (my) reading of your post actually can be construed as the correct answer. So I wanted to make sure I was attributing you adequately. :p

Anyhow, I probably shouldn't sermonize, but unlike with Winblows, puzzling situations like this in UNIX (almost) always have a rational answer that isn't related to "reboot your box, or reinstall cleanly from the setup CD".