Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EcDZ3-0005VW-7I for qemu-devel@nongnu.org; Tue, 15 Nov 2005 22:02:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EcDYw-0005Sx-4w for qemu-devel@nongnu.org; Tue, 15 Nov 2005 22:02:23 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EcDYr-0005Qg-PP for qemu-devel@nongnu.org; Tue, 15 Nov 2005 22:02:14 -0500 Received: from [221.122.43.98] (helo=fw.exoweb.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EcDYr-0007Qd-5X for qemu-devel@nongnu.org; Tue, 15 Nov 2005 22:02:13 -0500 Received: from [192.168.0.126] (helo=exo126.exoweb.net ident=shunwen) by fw.exoweb.net with esmtp (Exim 3.36 #1 (Debian)) id 1EcDYm-0006np-00 for ; Wed, 16 Nov 2005 11:02:08 +0800 Subject: Re: [Qemu-devel] why run qemu not use sudo, the /etc/qemu-ifup will not run From: swz In-Reply-To: <20051115153112.3607d653.user05@kyberwelt.de> References: <200511141653.22524.dfeustel@verizon.net> <1132051289.4464.9.camel@localhost.localdomain> <20051115153112.3607d653.user05@kyberwelt.de> Content-Type: text/plain; charset=gb2312 Date: Wed, 16 Nov 2005 11:02:27 +0800 Message-Id: <1132110147.4464.24.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Reply-To: swzhengst@gmail.com, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On =B6=FE, 2005-11-15 at 15:31 +0100, hmm wrote: > hi >=20 > > 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##/*/} >=20 > as you did not mention /etc/sudoers i suspect you did not configure > your sudoers(5) file.=20 I have configure my /etc/sudoers, like that: Cmnd_Alias QEMU=3D/sbin/ifconfig,/usr/sbin/brctl admin ALL=3D(ALL) ALL admin ALL=3DNOPASSWD: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:=20 #!/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:=20 "echo $* >> /tmp/qemu-ifup.$$" can tell me whether the script was run)