function _hosting_visudo_requirements in Hosting 5
File
- web_server/
hosting_web_server.module, line 82 - Web server node type is defined here.
Code
function _hosting_visudo_requirements() {
$username = HOSTING_DEFAULT_SCRIPT_USER;
$cmd = trim(str_replace("sudo", '', HOSTING_DEFAULT_RESTART_CMD));
$cmd = substr($cmd, 0, strpos($cmd, " "));
$visudo_cmd['@visudo_cmd'] = <<<EOF
sudo visudo
EOF;
$visudo_cmd['@visudo_line'] = <<<EOF
{<span class="php-variable">$username</span>} ALL=NOPASSWD: {<span class="php-variable">$cmd</span>}
EOF;
$help['title'] = t('Permission to restart the web server');
$help['summary'] = t('As the provisioning framework should not be run as root,
and the web server group should not be allowed access to the
functionality to stop/start the web server, it is required that you provide access
to the Apache restart command for the user account the script will be running as.
If this is not configured, every command will ask for a sudo password when restarting the server.');
$help['configuration'] = t('Run the visudo command: <pre>@visudo_cmd</pre>
Then add the following line to the file: <pre>@visudo_line</pre>', $visudo_cmd);
return $help;
}