Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-06-2005, 02:45 PM
|
#1
|
LQ Newbie
Registered: Apr 2005
Posts: 4
Rep:
|
Bash not spawning
I have a problem that I think is file permission related, I am just not sure how to go about figuring out which file has the problem, and I don't want to have to re-install the OS. I am running Fedora 3.
If I run the following shell script:
#!/bin/bash
echo "Hello"
I get nothing, but if I comment out the first line:
##!/bin/bash
echo "Hello"
I get Hello on the screen. If I run the first script from inside Apache, I get a permission error. The problem is that I need to have the first line in to run my CGI scripts and for some reason they won't execute if a shell has t be spawned.
The problem appears to be permissions, maybe with a lib file, but I have checked numerous files and made a few changes, returning them back the way they were, all to no avail.
If anyone has any suggestions on tracking this down, I would greatly appreciate it. I have to have this demo web server working by noon tomorrow for a demo!.
TIA
Norm
|
|
|
04-06-2005, 02:49 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
You could try running strace on the script:
strace /path/to/script
Also make sure that the user you are runnning the script as has read and execute privilages.
|
|
|
04-06-2005, 03:22 PM
|
#3
|
LQ Newbie
Registered: Apr 2005
Posts: 4
Original Poster
Rep:
|
I appreciate the advice of using strace. To respond to your question of user permissions, I have resorted to testing as root until I get the issue resolved.
In regards to the strace, this looks like it might give me some insight. I am running the strace on a Fedora machine that works and on the one that doesn't work and see that the traces are different. Can you please tell me how to get the output into a file? The > symbol just puts the Hello into the file. If I can get this into a file, I can do a diff and see the differences.
Thanks, I feel like I am getting a little closer.
Norm
|
|
|
04-06-2005, 03:34 PM
|
#4
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Well if it puts "hello" into the file then surely it is working?
You can output an strace into a file using "-o /tmp/bash.trace"
|
|
|
04-06-2005, 03:40 PM
|
#5
|
LQ Newbie
Registered: Apr 2005
Posts: 4
Original Poster
Rep:
|
Thanks again for the info. I should have looke dthat one up. Unfortunately, I am down to the wire to get this machine working.
The hello is on the working system. The one we are trying to get working is blank.
Here is the most obvious error on the one that isn't working.
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfe0d03c) = -1 ENOTTY (Inappropriate ioctl for device)
Any ideas?
Thanks
Norm
|
|
|
04-06-2005, 03:49 PM
|
#6
|
LQ Newbie
Registered: Apr 2005
Posts: 4
Original Poster
Rep:
|
Here are the actual 2 error lines that appear to be the errors that in the non-working version, but not in the trace of the working script:
open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = -1 ENXIO (No such device or address)
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbffad450) = -1 ENOTTY (Inappropriate ioctl for device)
|
|
|
All times are GMT -5. The time now is 11:39 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|