View previous topic :: View next topic |
Author |
Message |
newtonian Guru
Joined: 19 Jan 2005 Posts: 465 Location: Hokkaido Japan
|
Posted: Wed Jan 26, 2005 5:30 pm Post subject: gentoo and su -c [Solved] |
|
|
Hi-
I'm trying to get su -c to work on gentoo. Do I have to do anything special to get commands to run as something other than root?
Here's what I do on a redhat box:
Code: |
su -c "find / -name *.c > /dev/null" david
|
which results in:
Code: |
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1177 david 9 0 628 628 476 D 5.3 0.1 0:00 find
|
I do the same thing on my gentoo box:
Code: |
su -c "find / -iname *.o > /dev/null" david
|
Here are the results:
Code: |
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17312 root 25 0 4328 668 508 R 94.7 0.0 0:01.43 find
|
I'm assuming that it's just a usage problem on my part. Any ideas
Last edited by newtonian on Mon Feb 07, 2005 9:56 pm; edited 2 times in total |
|
Back to top |
|
|
hadfield Retired Dev
Joined: 18 Mar 2003 Posts: 308 Location: Vancouver, BC, Canada
|
Posted: Wed Jan 26, 2005 5:49 pm Post subject: |
|
|
Could be due to different versions of su or something, I'm not really sure though. But does it work as it should if you put the username first like so?
Quote: | su david -c "find / -name *.c > /dev/null" |
|
|
Back to top |
|
|
newtonian Guru
Joined: 19 Jan 2005 Posts: 465 Location: Hokkaido Japan
|
Posted: Thu Jan 27, 2005 3:28 pm Post subject: That did the trick |
|
|
Wow, That did the trick, thanks!
Cheers, |
|
Back to top |
|
|
|