LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 04-06-2005, 02:45 PM   #1
Norm-o
LQ Newbie
 
Registered: Apr 2005
Posts: 4

Rep: Reputation: 0
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
 
Old 04-06-2005, 02:49 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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.
 
Old 04-06-2005, 03:22 PM   #3
Norm-o
LQ Newbie
 
Registered: Apr 2005
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 04-06-2005, 03:34 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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"
 
Old 04-06-2005, 03:40 PM   #5
Norm-o
LQ Newbie
 
Registered: Apr 2005
Posts: 4

Original Poster
Rep: Reputation: 0
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
 
Old 04-06-2005, 03:49 PM   #6
Norm-o
LQ Newbie
 
Registered: Apr 2005
Posts: 4

Original Poster
Rep: Reputation: 0
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
perl spawning many process's Xris718 Programming 2 11-01-2005 12:50 PM
HELP: artsd keeps... spawning on KDE 3.4.2! dremelofdeath Linux - Software 2 08-09-2005 05:46 PM
Spawning multiple scp using different I/F sam0murphy Solaris / OpenSolaris 1 05-18-2005 08:21 AM
vsftp not spawning! cjpsparks Linux - Software 0 01-25-2005 06:55 PM
spawning too fast disabled for 5 minutes ajegilefajar Linux From Scratch 5 03-09-2004 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration