<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 5/25/2010 6:20 PM, Jakub Jedelsky wrote:
<blockquote cite="mid:4BFBC7AA.3030608@gmail.com" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
On 25.5.2010 14:27, Jatin Davey wrote:
  <blockquote cite="mid:4BFBC242.4090508@cisco.com" type="cite">
    <div class="moz-text-plain" wrap="true" graphical-quote="true"
 style="font-family: -moz-fixed; font-size: 12px;" lang="x-western">
    <pre wrap="">Hi

I have a linux box which has CentOS running in it. I logged into the box 
using root and wrote a script in the /home/proc_threads directory. saved 
the file and quit. I changed the file permissions such that any user 
could execute it using the "chmod 777 filename" command.

When i log out and log in as a non-root user i was not able to execute 
the script though.

Could some one please help in this regard. I am a newbie to linux.

Thanks
Jatin
_______________________________________________
CentOS mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:CentOS@centos.org">CentOS@centos.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a>
  </pre>
    </div>
  </blockquote>
  <br>
Hi,<br>
  <br>
have another users access to /home/proc_threads directory? :) Don't you
call any functions from script which can be executed only by root..?<br>
Send us the exact error which you get after execute your script as an
user.. If it is a bash script, you can debug it with "-x" option..<br>
  <br>
Excuse my english :)<br>
  <br>
Jakub J.<br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
CentOS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CentOS@centos.org">CentOS@centos.org</a>
<a class="moz-txt-link-freetext" href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a>
  </pre>
</blockquote>
Here is the script that i am trying to execute as a non-root user:<br>
<br>
#!/bin/sh<br>
ps -C java -o thcount > /home/proc_threads/tempfile<br>
awk ' { total += $1 } END { print total } ' /home/proc_threads/tempfile<br>
<br>
here is the output when i try to execute as a non-root user:<br>
<br>
./javathreads: line 2: /home/proc_threads/tempfile: Permission denied<br>
awk: cmd. line:1: fatal: cannot open file `/home/proc_threads/tempfile'
for reading (Permission denied)<br>
<br>
Thanks<br>
Jatin<br>
</body>
</html>