Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sudo won't allow me to echo 4 > /proc/acpi/sleep

 
   Linux (Home) -> Genreal Discussions RSS
Next:  How to handle .wpd files under Linux?  
Author Message
Jerome Werner

External


Since: Apr 01, 2004
Posts: 6



(Msg. 1) Posted: Thu Apr 01, 2004 9:08 am
Post subject: Sudo won't allow me to echo 4 > /proc/acpi/sleep
Archived from groups: alt>os>linux (more info?)

I use sudo to give my user all root abilities. Sudo works for everything
else. But when I try to do "sudo echo 4 > /proc/acpi/sleep" I get
permission denied. Instead, I need to do "su -" and then type in the
command as root that way. What's wrong with sudo here?

Sudo version 1.6.7p5 in debian unstable

Thanks
Back to top
Login to vote
red floyd

External


Since: Mar 17, 2004
Posts: 7



(Msg. 2) Posted: Thu Apr 01, 2004 5:17 pm
Post subject: Re: Sudo won't allow me to echo 4 > /proc/acpi/sleep [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jerome Werner wrote:
> I use sudo to give my user all root abilities. Sudo works for everything
> else. But when I try to do "sudo echo 4 > /proc/acpi/sleep" I get
> permission denied. Instead, I need to do "su -" and then type in the
> command as root that way. What's wrong with sudo here?
>

Because the "> /proc/api/sleep" is interpreted by the shell BEFORE
executing sudo.

Instead, try sudo "echo 4 > /proc/api/sleep"

Then the redirection operator is passed to the subshell invoked by sudo.
Back to top
Login to vote
Jerome Werner

External


Since: Apr 01, 2004
Posts: 6



(Msg. 3) Posted: Thu Apr 01, 2004 5:17 pm
Post subject: Re: Sudo won't allow me to echo 4 > /proc/acpi/sleep [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 01 Apr 2004 17:17:10 +0000, red floyd wrote:

> Jerome Werner wrote:
>> I use sudo to give my user all root abilities. Sudo works for everything
>> else. But when I try to do "sudo echo 4 > /proc/acpi/sleep" I get
>> permission denied. Instead, I need to do "su -" and then type in the
>> command as root that way. What's wrong with sudo here?
>>
>
> Because the "> /proc/api/sleep" is interpreted by the shell BEFORE
> executing sudo.
>
> Instead, try sudo "echo 4 > /proc/api/sleep"
>
> Then the redirection operator is passed to the subshell invoked by sudo.

Thanks for the help, but it still doesn't work:

$ sudo "echo 4 > /proc/acpi/sleep"
sudo: echo 4 > /proc/acpi/sleep: command not found
Back to top
Login to vote
red floyd

External


Since: Mar 17, 2004
Posts: 7



(Msg. 4) Posted: Thu Apr 01, 2004 7:23 pm
Post subject: Re: Sudo won't allow me to echo 4 > /proc/acpi/sleep [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jerome Werner wrote:
> On Thu, 01 Apr 2004 17:17:10 +0000, red floyd wrote:
>
>
>>Jerome Werner wrote:
>>
>>>I use sudo to give my user all root abilities. Sudo works for everything
>>>else. But when I try to do "sudo echo 4 > /proc/acpi/sleep" I get
>>>permission denied. Instead, I need to do "su -" and then type in the
>>>command as root that way. What's wrong with sudo here?
>>>
>>
>>Because the "> /proc/api/sleep" is interpreted by the shell BEFORE
>>executing sudo.
>>
>>Instead, try sudo "echo 4 > /proc/api/sleep"
>>
>>Then the redirection operator is passed to the subshell invoked by sudo.
>
>
> Thanks for the help, but it still doesn't work:
>
> $ sudo "echo 4 > /proc/acpi/sleep"
> sudo: echo 4 > /proc/acpi/sleep: command not found
>

sudo sh -c "echo 4 > /proc/api/sleep"
Back to top
Login to vote
P.T. Breuer

External


Since: Nov 05, 2003
Posts: 66



(Msg. 5) Posted: Fri Apr 02, 2004 2:00 am
Post subject: Re: Sudo won't allow me to echo 4 > /proc/acpi/sleep [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jerome Werner <jerome-werrner DeleteThis @excite.com> wrote:
> On Thu, 01 Apr 2004 17:17:10 +0000, red floyd wrote:
>
> > Jerome Werner wrote:
> >> I use sudo to give my user all root abilities. Sudo works for everything
> >> else. But when I try to do "sudo echo 4 > /proc/acpi/sleep" I get
> >> permission denied. Instead, I need to do "su -" and then type in the
> >> command as root that way. What's wrong with sudo here?
> >>
> >
> > Because the "> /proc/api/sleep" is interpreted by the shell BEFORE
> > executing sudo.
> >
> > Instead, try sudo "echo 4 > /proc/api/sleep"
> >
> > Then the redirection operator is passed to the subshell invoked by sudo.
>
> Thanks for the help, but it still doesn't work:
>
> $ sudo "echo 4 > /proc/acpi/sleep"
> sudo: echo 4 > /proc/acpi/sleep: command not found

Don't be so silly! What rubbish are you writing? If you want to pass a
1 to acpi/sleep you will have to sudo the command that does it. The
redirection is in YOUR shell, not in roots!

If you want to start a root shell that does the echo, then

sudo sh -c "echo 4 > /proc/acpi/sleep"

but what's the point? Just do

echo 4 | sudo dd of=/proc/acpi/sleep

or zillions of other alternatives ! Why do you choose precisely the
only combinations of nonsense to use, instead of writing something that
makes sense!

Peter
Back to top
Login to vote
Ohmster

External


Since: Oct 15, 2003
Posts: 15



(Msg. 6) Posted: Fri Apr 02, 2004 2:00 am
Post subject: Re: Sudo won't allow me to echo 4 > /proc/acpi/sleep [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ptb DeleteThis @oboe.it.uc3m.es (P.T. Breuer) wrote in
news:3eai4c.4d7.ln@news.it.uc3m.es:

> If you want to start a root shell that does the echo, then
>
> sudo sh -c "echo 4 > /proc/acpi/sleep"
>
> but what's the point? Just do
>
> echo 4 | sudo dd of=/proc/acpi/sleep
>
> or zillions of other alternatives ! Why do you choose precisely the
> only combinations of nonsense to use, instead of writing something that
> makes sense!
>

<giggle> I just *love* it when a pretty darned experienced user makes a
comment. What is clear to Peter is a new revelation to most of us. Thanks
Peter.

--
~Ohmster
Back to top
Login to vote
Display posts from previous:   
Related Topics:
echo --help ? - Hi The man page told me echo --help will print me the help. But i print me "--help". so howto? thanks from Peter (cmk128@hotmail.com)

sudo with my aliases - Hello, sudo command doesn't understand the alias I defined. How can I make "sudo" work with the aliases I defined for my account? Thanks. Sam

Use sudo to kill one of root's processes? - Can you use sudo to kill one of root's processes? I wrote a script that runs under a normal user. It searches to see if more than one instance of a daemon is running. If it is, it grabs the process id and tries to kill it. But the daemon is being run...

How to restrict the su command? Not sudo - First off, I already know about sudo, that's not what I want. I'm looking for a method to restrict usage of the su command to specific users. On Slackware, I had an /etc/suath file where I could specify which users were allowed to use su but that..

Sleep / Standby mode in linux - Hi to all: Does anyone know how to set the system sleep/standby mode in linux? I can't find related command regarding these...only "hdparm". While "hdparm" is direct controlling harddrive but not the OS/system. Any advice is welcome...
       Linux (Home) -> Genreal Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
  Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact