centos 5.2 - Apache having trouble sudo'ing httpd graceful
All -
I have a script which needs to execute the following command:
sudo /etc/init.d/httpd graceful
In the sudoers file, I have commented out requiretty and added
apache sz2 = NOPASSWD: /etc/init.d/httpd graceful
Performing an su - apache -s /bin/bash, then executing "sudo /etc/init.d/httpd graceful" will execute. However, when I have the following command in a php script and execute from a browser:
<?
echo exec('sudo /etc/init.d/httpd graceful');
?>
it won't work.
The thing is, if I execute 'setenforce 0' to turn selinux off, it works. I've attempted to change security context on the init.d/httpd script to httpd_sys_content_t, and the same thing for the /usr/sbin/httpd file to no avail.
Any suggestions on how I can get this to execute?
|
Recent comments
11 hours 37 min ago
12 hours 36 min ago
16 hours 23 min ago
17 hours 37 min ago
21 hours 14 min ago
1 day 4 hours ago
1 day 13 hours ago
1 day 14 hours ago
2 days 5 hours ago
2 days 8 hours ago