Thanks for the tips. sudo reboot or sudo shutdown -r now doesn't work either. Changing apache config files wouldn't also help because I can't restart apache or maybe I can use "service restart httpd" ???
> Date: Mon, 12 Jan 2009 16:46:44 -0500 > From: [email protected] > To: [email protected] > CC: [email protected] > Subject: Re: [on-asterisk] A linux question > > Bruce Nik wrote: >> Should the following file (if run from [a browser]) reboot the system: >> /var/www/cgi-bin/reboot >> >> #!/bin/bash >> echo "Content-type: text/html" >> echo "" >> echo "Bash as CGI" >> echo "" >> echo "Rebooting now $(shutdown -r now)" >> echo "" >> >> > It might, but not on a correctly configured system. > > The web server account should not have system admin privileges on the > machine, > for obvious and basic security reasons. > > You might be able to allow it using sudo; you'd just have to make an > entry in the > sudo config file to allow "apache" or "httpd" or whatever, to use the > command "shutdown -r". > > I would also change the 2nd last line to: > > echo "Rebooting now..." > sudo shutdown -r now > > e.g., there is no reason to embed the shutdown inside an echo, it wouldn't > seem to buy you anything. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > _________________________________________________________________ Drag n’ drop—Get easy photo sharing with Windows Live™ Photos. http://www.microsoft.com/windows/windowslive/photos.aspx --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
