Super User For Apache..!! CBQ permissions...help..!!!
Hi
i am doing a project on bandwidth management.I am using CBQ with some database. The project has a script that has to run in CGI....the script has to execute the command to restart the CBQ service...
Everything works fine except that i cannot execute the shell command from CGI or PHP exec() function,,,
code attached below for reference..
//file getinfo.sh
sh /etc/sysconfig/cbq/restartcbq.sh
//file restartcbq.sh
echo -e "SETTING UP CBQ CLASS <br>"
sleep 1
echo -e "service cbq.init restart nocache "
echo -e "$(su)"
echo -e "<pre> $(service cbq.init restart nocache)</pre>"
echo -e "service cbq.init stats ##########Statistics ##########"
echo -e "<pre> $(service cbq.init stats) </pre>"
echo -e "<br> DONE................................Please Proceed<br>"
// OUTPUT in Webpage
DTU-ISP Suite--SHELL OUTPUT
SETTING UP CBQ CLASS
service cbq.init restart nocache
**CBQ: failed to add class 21 with parent on eth0!
service cbq.init stats ##########Statistics ##########
### eth0: queueing disciplines
qdisc sfq 21: quantum 1514b perturb 10sec
Sent 6293 bytes 20 pkts (dropped 0, overlimits 0)
qdisc cbq 1: rate 10Mbit (bounded,isolated) prio no
<snip>
the same command can be executed from shell with no error what so ever. I have tried adding the following line to /etc/sudoers in the end but its of no use.
<snip>
apache ALL = (ALL) NOPASSWD: /etc/rc.d/init.d/cbq.init,/sbin/tc,/sbin/ip
<snip>
i have also tried giving 777 in chmod to all files in /etc/sysconfig /var/www/html/ /var/www/cgi-bin/ and /etc/rc.d/init.d/
please tell me if i am wrong somewhere...or some superuser thing is missing... i have been googling around...but no success.!
please help..!!!!
thnx in anticipation
Ujjwal
Last edited by ujjwal_wadhawan; 03-03-2006 at 12:09 AM.
|