qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] why run qemu not use sudo, the /etc/qemu-ifup will not


From: swz
Subject: Re: [Qemu-devel] why run qemu not use sudo, the /etc/qemu-ifup will not run
Date: Wed, 16 Nov 2005 11:02:27 +0800

On 二, 2005-11-15 at 15:31 +0100, hmm wrote:
> hi
> 
> > I put the next three line into /etc/qemu-ifup.
> > #!/bin/sh
> > echo $* >> /tmp/qemu-ifup.$$
> > sudo /sbin/ifconfig ${1##/*/} 0.0.0.0 promisc up
> > sudo /usr/sbin/brctl addif bridge ${1##/*/}

> 
> as you did not mention /etc/sudoers i suspect you did not configure
> your sudoers(5) file. 

I have configure my /etc/sudoers, like that:

Cmnd_Alias QEMU=/sbin/ifconfig,/usr/sbin/brctl
admin   ALL=(ALL) ALL
admin   ALL=NOPASSWD:QEMU


So if someone run qemu, it will use sodu to run ifconfig and brctl.

my question is: when I configure no mattler like above or as bellow: 

#!/bin/sh
echo $* >> /tmp/qemu-ifup.$$
/sbin/ifconfig ${1##/*/} 0.0.0.0 promisc up
/usr/sbin/brctl addif bridge ${1##/*/}

the script will run when use root. But when not use root or sudo, the
script won't run. I don't know why. ( the script: 
"echo $* >> /tmp/qemu-ifup.$$"  can tell me whether the script was run)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]