How do I delete my blog?
cant run bash scripts..
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• RYXI
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

RYXI > Linux > cant run bash scripts.. 30 November 2007 16:59:02

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

cant run bash scripts..

Vihang 7 November 2005 12:08:21
 i cant execute any bash script in the directory /var/www/html/cgi-b­in
if i copy the same bash script to the /tmp or anyother for that matter
i am able to exucute it what can be the prob.

___________________­_________________
root@one[/var/www/html/cgi-bin]# cat tmp
#!/bin/sh
echo "hey hey"
root@one[/var/www/html/cgi-bin]#
root@one[/var/www/html/cgi-bin]# ./tmp
root@one[/var/www/html/cgi-bin]#
root@one[/var/www/html/cgi-bin]# cp tmp /tmp/tmp
root@one[/var/www/html/cgi-bin]# /tmp/tmp
hey hey
root@one[/var/www/html/cgi-bin]#
___________________­_________________

what can be the prob??

thanks in advance

Add comment
Laurenz Albe 7 November 2005 13:26:50 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:> i cant execute any bash script in the directory /var/www/html/cgi-b­in> if i copy the same bash script to the /tmp or anyother for that matter> i am able to exucute it what can be the prob.>
___________________­_________________> root@one[/var/www/html/cgi-bin]# cat tmp> #!/bin/sh> echo "hey hey"> root@one[/var/www/html/cgi-bin]#> root@one[/var/www/html/cgi-bin]# ./tmp> root@one[/var/www/html/cgi-bin]#> root@one[/var/www/html/cgi-bin]# cp tmp /tmp/tmp> root@one[/var/www/html/cgi-bin]# /tmp/tmp> hey hey> root@one[/var/www/html/cgi-bin]#> ___________________­_________________>
what can be the prob??

Weird. There is no error message?

Are there any changes in behaviour if you invoke the script as
/var/www/html/cgi-b­in/tmp?

Are there any aliases defined?
What is the output of 'sh -x ./tmp' ?
What is the output of 'which ./tmp' ?

Yours,
Laurenz Albe
Add comment
Vihang 7 November 2005 13:44:33 permanent link ]
 Nope there is no error message..
and there are no aliases defined..
the are the outputs you asked..

any hint???

thanks in advance...

___________________­____________________­______________
root@one[/var/www/html/cgi-bin]# /var/www/html/cgi-b­in/tmp
root@one[/var/www/html/cgi-bin]#
root@one[/var/www/html/cgi-bin]# sh -x ./tmp
+ echo 'hey hey'
hey hey
root@one[/var/www/html/cgi-bin]#
root@one[/var/www/html/cgi-bin]# which ./tmp
./tmp
root@one[/var/www/html/cgi-bin]#

Add comment
Laurenz Albe 7 November 2005 14:28:33 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:> Nope there is no error message..> and there are no aliases defined..> the are the outputs you asked..>
any hint???>
thanks in advance...>
___________________­____________________­______________> root@one[/var/www/html/cgi-bin]# /var/www/html/cgi-b­in/tmp> root@one[/var/www/html/cgi-bin]#> root@one[/var/www/html/cgi-bin]# sh -x ./tmp> + echo 'hey hey'> hey hey> root@one[/var/www/html/cgi-bin]#> root@one[/var/www/html/cgi-bin]# which ./tmp> ./tmp> root@one[/var/www/html/cgi-bin]#

See what really happens:

strace -f ./tmp

and look for the problem in the output on stderr. Post the output
if you cannot find the problem.

Yours,
Laurenz Albe
Add comment
Bill Marcum 7 November 2005 16:57:29 permanent link ]
 On 7 Nov 2005 01:08:21 -0800, vihang
<vihang007@gmail.co­m> wrote:> i cant execute any bash script in the directory /var/www/html/cgi-b­in> if i copy the same bash script to the /tmp or anyother for that matter> i am able to exucute it what can be the prob.>
Is /var/www/html/cgi-b­in mounted noexec? (look in /etc/fstab)


--
Growing old isn't bad when you consider the alternatives.
-- Maurice Chevalier
Add comment
Laurenz Albe 7 November 2005 18:20:32 permanent link ]
 Bill Marcum <bmarcum@iglou.com>­ wrote:>> i cant execute any bash script in the directory /var/www/html/cgi-b­in>> if i copy the same bash script to the /tmp or anyother for that matter>> i am able to exucute it what can be the prob.>
Is /var/www/html/cgi-b­in mounted noexec? (look in /etc/fstab)

This would (at least on my system) produce an error message.

Yours,
Laurenz Albe
Add comment
Vihang 8 November 2005 11:55:59 permanent link ]
 thanks for the reply...
i went through the output but i could not find the problem so here is
the output
thanks again..
___________________­____________________­____________________­_________
execve("./tmp", ["./tmp"], [/* 24 vars */]) = 0
uname({sys="Linux",­ node="one", ...}) = 0
brk(0) = 0x82f9000
access("/etc/ld.sopreload", R_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.ca­che", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|06­44, st_size=131101, ...}) = 0
old_mmap(NULL, 131101, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6fdf000
close(3) = 0
open("/lib/libtermc­ap.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\­0\0\0\0\0\0\0\3\0\3\­0\1\0\0\0\320\333"..­.,
512) = 512
fstat64(3, {st_mode=S_IFREG|07­55, st_size=12592, ...}) = 0
old_mmap(0xbfd000, 14280, PROT_READ|PROT_EXEC­,
MAP_PRIVATE|MAP_DEN­YWRITE, 3, 0) = 0xbfd000
old_mmap(0xc00000, 4096, PROT_READ|PROT_WRIT­E,
MAP_PRIVATE|MAP_FIX­ED|MAP_DENYWRITE, 3, 0x2000) = 0xc
00000
close(3) = 0
open("/lib/libdl.so­.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\­0\0\0\0\0\0\0\3\0\3\­0\1\0\0\0\260+\240".­..,
512) = 512
fstat64(3, {st_mode=S_IFREG|07­55, st_size=16908, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS,
-1, 0) = 0xf6fde000
old_mmap(0xa02000, 12388, PROT_READ|PROT_EXEC­,
MAP_PRIVATE|MAP_DEN­YWRITE, 3, 0) = 0xa02000
old_mmap(0xa04000, 8192, PROT_READ|PROT_WRIT­E,
MAP_PRIVATE|MAP_FIX­ED|MAP_DENYWRITE, 3, 0x1000) = 0xa
04000
close(3) = 0
open("/lib/tls/libc­.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\­0\0\0\0\0\0\0\3\0\3\­0\1\0\0\0 \217\214"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|07­55, st_size=1512400, ...}) = 0
old_mmap(0x8b4000, 1207532, PROT_READ|PROT_EXEC­,
MAP_PRIVATE|MAP_DEN­YWRITE, 3, 0) = 0x8b4000
old_mmap(0x9d5000, 16384, PROT_READ|PROT_WRIT­E,
MAP_PRIVATE|MAP_FIX­ED|MAP_DENYWRITE, 3, 0x120000) =
0x9d5000
old_mmap(0x9d9000, 7404, PROT_READ|PROT_WRIT­E,
MAP_PRIVATE|MAP_FIX­ED|MAP_ANONYMOUS, -1, 0) = 0x9d900
0
close(3) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS,
-1, 0) = 0xf6fdd000
mprotect(0xa04000, 4096, PROT_READ) = 0
mprotect(0x9d5000, 8192, PROT_READ) = 0
mprotect(0x8ac000, 4096, PROT_READ) = 0
set_thread_area({en­try_number:-1 -> 6, base_addr:0xf6fdd6c­0,
limit:1048575, seg_32bit:1, contents:0,
read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xf6fdf000, 131101) = 0
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
open("/dev/tty", O_RDWR|O_NONBLOCK|O­_LARGEFILE) = -1 ENXIO (No such
device or address)
ioctl(0, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfef5ae40) = -1 ENOTTY
(Inappropriate ioctl for device)
brk(0) = 0x82f9000
brk(0x831a000) = 0x831a000
open("/usr/lib/loca­le/locale-archive", O_RDONLY|O_LARGEFIL­E) = 3
fstat64(3, {st_mode=S_IFREG|06­44, st_size=38653680, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6ddd000
close(3) = 0
getuid32() = 0
getgid32() = 0
geteuid32() = 0
getegid32() = 0
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
time(NULL) = 1131439920
open("/etc/mtab", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|06­44, st_size=457, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,
0) = 0xf6ddc000
read(3, "/dev/hda1 / ext3 rw 0 0\nnone /pr"..., 4096) = 457
close(3) = 0
munmap(0xf6ddc000, 4096) = 0
open("/proc/meminfo­", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|04­44, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,
0) = 0xf6ddc000
read(3, "MemTotal: 1035136 kB\nMemFre"..., 1024) = 644
close(3) = 0
munmap(0xf6ddc000, 4096) = 0
rt_sigaction(SIGCHL­D, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGCHL­D, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT­, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT­, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUI­T, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUI­T, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
rt_sigaction(SIGQUI­T, {SIG_IGN}, {SIG_DFL}, 8) = 0
uname({sys="Linux",­ node="one", ...}) = 0
stat64("/var/www/ht­ml/cgi-bin", {st_mode=S_IFDIR|07­11, st_size=4096,
...}) = 0
stat64(".", {st_mode=S_IFDIR|07­11, st_size=4096, ...}) = 0
getpid() = 19409
open("/usr/lib/gcon­v/gconv-modules.cach­e", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|06­44, st_size=21544, ...}) = 0
mmap2(NULL, 21544, PROT_READ, MAP_SHARED, 3, 0) = 0xf6dd7000
close(3) = 0
getppid() = 19408
getpgrp() = 19408
rt_sigaction(SIGCHL­D, {0x8077263, [], SA_RESTORER, 0x8dba48}­,
{SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
open("./tmp", O_RDONLY|O_LARGEFIL­E) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfef5af58) = -1 ENOTTY
(Inappropriate ioctl for device)
_llseek(3, 0, [0], SEEK_CUR) = 0
read(3, "#!/bin/sh\necho \"hey hey\"\n", 80) = 25
_llseek(3, 0, [0], SEEK_SET) = 0
getrlimit(RLIMIT_NO­FILE, {rlim_cur=1024, rlim_max=1024}) = 0
dup2(3, 255) = 255
close(3) = 0
fcntl64(255, F_SETFD, FD_CLOEXEC) = 0
fcntl64(255, F_GETFL) = 0x8000 (flags
O_RDONLY|O_LARGEFIL­E)
fstat64(255, {st_mode=S_IFREG|07­55, st_size=25, ...}) = 0
_llseek(255, 0, [0], SEEK_CUR) = 0
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
read(255, "#!/bin/sh\necho \"hey hey\"\n", 25) = 25
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
fstat64(1, {st_mode=S_IFCHR|06­66, st_rdev=makedev(1, 3), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfef5a68c) = -1 ENOTTY
(Inappropriate ioctl for device)
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,
0) = 0xf6dd6000
write(1, "hey hey\n", 8) = 8
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0
read(255, "", 25) = 0
munmap(0xf6dd6000, 4096) = 0
exit_group(0) = ?

Add comment
Peter T. Breuer 8 November 2005 12:34:11 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:> thanks for the reply...> i went through the output but i could not find the problem so here is

What problem? Please include CONTEXT!
open("/dev/tty", O_RDWR|O_NONBLOCK|O­_LARGEFILE) = -1 ENXIO (No such> device or address)

And your problem with that is? Are you running on a tty or not?

open("/etc/mtab", O_RDONLY) = 3

Why are you running mount? Curious.
read(3, "/dev/hda1 / ext3 rw 0 0\nnone /pr"..., 4096) = 457
open("/proc/meminfo­", O_RDONLY) = 3> read(3, "MemTotal: 1035136 kB\nMemFre"..., 1024) = 644

rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0> open("./tmp", O_RDONLY|O_LARGEFIL­E) = 3

Uhhhhhhhhh. Why? Is this stdin?
read(3, "#!/bin/sh\necho \"hey hey\"\n", 80) = 25

How come "tmp" contains shell stuff?
dup2(3, 255) = 255

Hmm.
read(255, "#!/bin/sh\necho \"hey hey\"\n", 25) = 25> rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0> fstat64(1, {st_mode=S_IFCHR|06­66, st_rdev=makedev(1, 3), ...}) = 0> ioctl(1, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfef5a68c) = -1 ENOTTY> (Inappropriate ioctl for device)> mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,> 0) = 0xf6dd6000> write(1, "hey hey\n", 8) = 8

The shell script executed fine.
rt_sigprocmask(SIG_­BLOCK, NULL, [], 8) = 0> read(255, "", 25) = 0

Nothing more.

All works fine. What are you complaining about?

Peter
Add comment
Laurenz Albe 8 November 2005 14:56:19 permanent link ]
 First of all, don't get annoyed by the aimless rantings of Peter.
He expends a lot of energy on confusing people and telling himself how
great he is.

vihang <vihang007@gmail.co­m> wrote:> i went through the output but i could not find the problem so here is> the output> ___________________­____________________­____________________­_________
[...]> fstat64(1, {st_mode=S_IFCHR|06­66, st_rdev=makedev(1, 3), ...}) = 0> ioctl(1, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfef5a68c) = -1 ENOTTY (Inappropriate ioctl for device)> mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1, 0) = 0xf6dd6000> write(1, "hey hey\n", 8) = 8
[...]

The problem must be somewhere there. On my system, the following happens:

fstat64(1, {st_mode=S_IFCHR|06­20, st_rdev=makedev(136­, 2), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1, 0) = 0xb73da000
write(1, "hey hey\n", 8) = 8

The first thing that is obvious is that the echo command is executed,
the "hey hey" line is written to file 1 (standard output), it just fails to
appear on the screen.

So what is standard output in your case?

The fstat64 call gives us the answer.
On my machine, file 1 has major number 136 and minor number 2, that is
/dev/pts/2, a Unix pseudo-TTY connected to my xterm.

In your case, file 1 has major 1 and minor 3, which is /dev/null.

(You can consult /usr/src/linux/Docu­mentation/devices.tx­t for that info).

So somehow you have redirected standard output to /dev/null, and your
output is not displayed.

Am I correct that if you './tmp >out', the file output contains the correct
output`?

I cannot say more without examining your system or setup - maybe the
/devNull thing rings a bell and you find out what went wrong.

Yours,
Laurenz Albe
Add comment
Vihang 9 November 2005 13:28:38 permanent link ]
 first of all thanks for your reply.now that is interesting after your
post i
just checked the output of the script in the different directory and
the
result are really puzzling..

the results for "root@one[/var/www/html/cgi-bin]# strace -f ./tmp" in
/var/www/html/cgi-b­in directory are
-------------------­--------------------­--------------------­--------------------­-------------
fstat64(1, {st_mode=S_IFCHR|06­66, st_rdev=makedev(1, 3), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfee3e9ac) = -1 ENOTTY
(Inappropriate ioctl for device)
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,
0) = 0xf6dd6000
write(1, "hey hey\n", 8) = 8
___________________­____________________­________________

And the results for the root@one[/tmp]# strace -f ./tmp
in /tmp directory are
___________________­____________________­________________
fstat64(1, {st_mode=S_IFREG|06­44, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,
0) = 0xf6dd6000
write(1, "hey hey\n", 8) = 8
___________________­____________________­____________________­___

now how is that possible??
i am really puzzled..

Add comment
Peter T. Breuer 9 November 2005 14:17:28 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:> the results for "root@one[/var/www/html/cgi-bin]# strace -f ./tmp" in> /var/www/html/cgi-b­in directory are> -------------------­--------------------­--------------------­--------------------­-------------> fstat64(1, {st_mode=S_IFCHR|06­66, st_rdev=makedev(1, 3), ...}) = 0

What is your stdout connected to? It appears to be chardev 1:3, i.e.
/dev/null.

crw-rw-rw- 1 root 1, 3 Apr 12 2004 /dev/null

ioctl(1, SNDCTL_TMR_TIMEBASE­ or TCGETS, 0xfee3e9ac) = -1 ENOTTY

It's not a tty!
(Inappropriate ioctl for device)> mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,> 0) = 0xf6dd6000> write(1, "hey hey\n", 8) = 8> ___________________­____________________­________________
And the results for the root@one[/tmp]# strace -f ./tmp> in /tmp directory are> ___________________­____________________­________________> fstat64(1, {st_mode=S_IFREG|06­44, st_size=0, ...}) = 0

This time stdout is a regular file. You probbaly just created it.
mmap2(NULL, 4096, PROT_READ|PROT_WRIT­E, MAP_PRIVATE|MAP_ANO­NYMOUS, -1,> 0) = 0xf6dd6000> write(1, "hey hey\n", 8) = 8> ___________________­____________________­____________________­___
now how is that possible??

You have written a bad script. Fix it please. It looks like you are
writing to a relative path within the script. In one instance that path
points to /dev/null, and in anther instance, not. That might be due to
a symlink.

You alone know. Tell us.


Peter
Add comment
Laurenz Albe 9 November 2005 18:01:25 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:> i am really puzzled..

There is one thing I noticed in the original strace output you posted:

open("/dev/tty", O_RDWR|O_NONBLOCK|O­_LARGEFILE) = -1 ENXIO (No such device or address)

I didn't see that at first.

That looks like you have no /dev/tty entry.

- Are you sure that the script works ON THE SAME MACHINE in a different
directory? Or did you do the other, working, example on a different
machine?

- If both samples were indeed run on the same machine, what is the
corresponding line in the strace output of the working example?

- What is the result of 'ls -l /dev/tty' on the machine with the problem?

Yours,
Laurenz Albe
Add comment
Vihang 10 November 2005 13:04:24 permanent link ]
 
Laurenz Albe wrote:> vihang <vihang007@gmail.co­m> wrote:> > i am really puzzled..>
There is one thing I noticed in the original strace output you posted:>
open("/dev/tty", O_RDWR|O_NONBLOCK|O­_LARGEFILE) = -1 ENXIO (No such device or address)>
I didn't see that at first.>
That looks like you have no /dev/tty entry.>
- Are you sure that the script works ON THE SAME MACHINE in a different> directory? Or did you do the other, working, example on a different> machine?

yes i am sure of that..
- If both samples were indeed run on the same machine, what is the> corresponding line in the strace output of the working example?

fstat64(1, {st_mode=S_IFCHR|06­20, st_rdev=makedev(136­, 0), ...}) = 0

i still dont get how is the device no is chaning for diffenrent
directory..
- What is the result of 'ls -l /dev/tty' on the machine with the problem?>
vihang@one[~]$ ll /dev/tty
crw-rw-rw- 1 root root 5, 0 Nov 10 14:58 /dev/tty

Add comment
Laurenz Albe 10 November 2005 15:27:13 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:>> There is one thing I noticed in the original strace output you posted:>>
open("/dev/tty", O_RDWR|O_NONBLOCK|O­_LARGEFILE) = -1 ENXIO (No such device or address)>>
- If both samples were indeed run on the same machine, what is the>> corresponding line in the strace output of the working example?>
fstat64(1, {st_mode=S_IFCHR|06­20, st_rdev=makedev(136­, 0), ...}) = 0

What I'm interested in is the open("/dev/tty" line.

Also it would be nice to know how you get to your command line:
- Are you on the console, an xterm, connect via telnet or ssh?

Am I correct that you can repeat the problem at will, i.e. execute
the script in /tmp and the one in /var/... in any order, and the former
always works, the latter never?

If you compare the shell scripts with 'cmp <file1> <file2>', is there
an output?

What version of util-linux are you using (rpm -qi util-linux|grep Version)?

I'm grasping at straws here, I admit that I have no clue why your
shell script cannot open /dev/tty.

Yours,
Laurenz Albe
Add comment
Vihang 15 November 2005 11:54:37 permanent link ]
 
Laurenz Albe wrote:>
Also it would be nice to know how you get to your command line:> - Are you on the console, an xterm, connect via telnet or ssh?

it happens on the xterm as well as console
Am I correct that you can repeat the problem at will, i.e. execute> the script in /tmp and the one in /var/... in any order, and the former> always works, the latter never?

nope whichever script is created in /var/www/html doesn't show the
output.
If you compare the shell scripts with 'cmp <file1> <file2>', is there> an output?

none> What version of util-linux are you using (rpm -qi util-linux|grep Version)?

root@one[/var]# rpm -qi util-linux|grep Version
Version : 2.12a Vendor: Red Hat, Inc.

I'm grasping at straws here, I admit that I have no clue why your> shell script cannot open /dev/tty.

can this happen because of selinux..
i am out of options..

Add comment
Vihang 15 November 2005 11:55:48 permanent link ]
 
Laurenz Albe wrote:>
Also it would be nice to know how you get to your command line:> - Are you on the console, an xterm, connect via telnet or ssh?

it happens on the xterm as well as console
Am I correct that you can repeat the problem at will, i.e. execute> the script in /tmp and the one in /var/... in any order, and the former> always works, the latter never?

nope whichever script is created in /var/www/html doesn't show the
output.
If you compare the shell scripts with 'cmp <file1> <file2>', is there> an output?

none> What version of util-linux are you using (rpm -qi util-linux|grep Version)?

root@one[/var]# rpm -qi util-linux|grep Version
Version : 2.12a Vendor: Red Hat, Inc.

I'm grasping at straws here, I admit that I have no clue why your> shell script cannot open /dev/tty.

can this happen because of selinux..
i am out of options..

Add comment
Laurenz Albe 15 November 2005 12:16:24 permanent link ]
 vihang <vihang007@gmail.co­m> wrote:> nope whichever script is created in /var/www/html doesn't show the> output.>
I'm grasping at straws here, I admit that I have no clue why your>> shell script cannot open /dev/tty.>
can this happen because of selinux..> i am out of options..

Hmm. I realize now that you never said what distribution etc. you are
using. So please, what distribution and version is this, and have you
changed anything from the default settings? New kernel?

I have no idea about SELinux, but the FAQ suggests that you run in
permissive mode (echo "0" >/selinux/enforce) and look at the "denied"
messages in the log files.

Yours,
Laurenz Albe
Add comment
Vihang 16 November 2005 12:06:17 permanent link ]
 
Laurenz Albe wrote:> Hmm. I realize now that you never said what distribution etc. you are> using. So please, what distribution and version is this, and have you> changed anything from the default settings? New kernel?

i am using fedora core 3. with kernel 2.6.9-1.667 i haven't changed
anything.
I have no idea about SELinux, but the FAQ suggests that you run in> permissive mode (echo "0" >/selinux/enforce) and look at the "denied"> messages in the log files.

i will take a look at this..

thanks..

Add comment
Guest 30 November 2007 16:59:02 permanent link ]
 The output is not displayed because of security context 'httpd_sys_script_e­xec_t'.

[root@beta cgi-bin]# ls --scontext *
user_u:object_r:htt­pd_sys_script_exec_t­ test.bin
[root@beta cgi-bin]#

For example, if the security context for myscript.sh is changed using the command chcon -c "system_u:object_r:­httpd_sys_script_exe­c_t" myscript.sh, then the output of this script will not be displayed as well.

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


RYXI > Linux > cant run bash scripts.. 30 November 2007 16:59:02

see also:
Any freeware tool to join images into…
1by1 1.53
Nero Burner
pass tests:
see also:
Welcome!
Hi!
pancake

  Copyright © 2001—2010 RYXI
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.ryxi.com.
Write in the community about the bugs you have noticedbugs.ryxi.com.
Write your offers and comments in the communities suggest.ryxi.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .