permission denied error when restart dhcp3-server
Hello..
I have a script that needs to restart my dhcp3-server but is unable to. The server is ran by root by default. I try to issue "/etc/init.d/dhcp3-server restart" from a php script and I get a permission denied error. How can I work around to be able to stop and restart the dhcp3 server or how can I run it with a different user? |
Add the apache user to sudoers, and grant him the right to execute exactly that
command above. |
Quote:
visudo www-data ALL: NOPASSWD /etc/init.d/dhcp3-server restart The error I get is that it can't kill the process id since is running by root. I even changed the ownership to www-data to /var/run/dhcp.pid file and that still can't kill the process and run the new configuration. Any other idea? |
That's not a valid sudoers line, it has no = anywhere.
How did you manage to save that w/o it swearing at you? Cheers, Tink |
Quote:
www-data ALL= NOPASSD: /etc/init.d/dhcp3-server restart |
and the W in NOPASSWD?
|
Quote:
|
All times are GMT -5. The time now is 03:44 PM. |