Hi!
Updated (minor upgrade) to Erasmus 3.0.62 and the Linux kernel 4.9.0-0.bpo.1-amd63.
After reboot, I get the following error:
Error #0:
exception 'OMV\ExecException' with message 'Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; monit summary 2>&1' with exit code '1': Monit: the monit HTTP interface is not enabled, please add the 'set httpd' statement and use the 'allow' option to allow monit to connect' in /usr/share/php/openmediavault/system/process.inc:175
Stack trace:
#0 /usr/share/php/openmediavault/system/monit.inc(142): OMV\System\Process->execute(Array)
#1 /usr/share/php/openmediavault/system/monit.inc(161): OMV\System\Monit->status()
#2 /usr/share/openmediavault/engined/module/nut.inc(105): OMV\System\Monit->isRunning()
#3 /usr/share/openmediavault/engined/rpc/services.inc(56): OMVModuleNetworkUPSTools->getStatus()
#4 [internal function]: OMVRpcServiceServices->getStatus(Array, Array)
#5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array)
#6 /usr/share/php/openmediavault/rpc/rpc.inc(84): OMV\Rpc\ServiceAbstract->callMethod('getStatus', Array, Array)
#7 /usr/sbin/omv-engined(516): OMV\Rpc\Rpc::call('Services', 'getStatus', Array, Array, 1)
#8 {main}
Any idea on what to do?
Seems I need to edit "/usr/share/php/openmediavault/system/process.inc" on row 175, but with what?
This is what the file looks like now:
root@openmediavault:/usr/share/php/openmediavault/system# cat process.inc
<?php
/**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2017 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* OpenMediaVault is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
*/
namespace OMV\System;
/**
* @ingroup api
*/
class Process {
use \OMV\Debugable;
private $cmdArgs = [];
private $redirect1toFile = FALSE;
private $redirect2toFile = FALSE;
private $inputFromFile = FALSE;
private $quiet = FALSE;
private $background = FALSE;
private $env = array(
"PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
"LANG=C"
);
/**
* Constructor
* Example:
* $cmd = new \OMV\System\Process("ls -alh");
* $cmd = new \OMV\System\Process("ls", "-al", "-h");
* $cmd = new \OMV\System\Process(array("ls", "-alh"));
* $cmd = new \OMV\System\Process("ls", array("-a", "-l", "-h"));
*/
public function __construct() {
$args = func_get_args();
if (1 == func_num_args() && is_string($args[0])) {
$this->cmdArgs[] = $args[0];
} else if (1 == func_num_args() && is_array($args[0])) {
$this->cmdArgs = $args[0];
} else if (2 == func_num_args() && is_string($args[0])) {
$this->cmdArgs[] = $args[0];
if (is_array($args[1]))
$this->cmdArgs = array_merge($this->cmdArgs, $args[1]);
else
$this->cmdArgs[] = $args[1];
} else {
$this->cmdArgs = $args;
}
}
/**
* Redirect STDOUT to the given file. Set to FALSE to do not redirect
* STDOUT to a file.
* @param file The file path, e.g. '/tmp/xyz'.
* @return None.
*/
public function setRedirect1toFile($file) {
$this->redirect1toFile = $file;
}
/**
* Redirect STDERR to STDOUT.
* @return None.
*/
public function setRedirect2to1() {
$this->setRedirect2toFile("&1");
}
/**
* Redirect STDERR to the given file. Set to FALSE to do not redirect
* STDERR to a file.
* @param file The file path, e.g. '/dev/null' or '&1'.
* @return None.
*/
public function setRedirect2toFile($file) {
$this->redirect2toFile = $file;
}
/**
* Accept input from a file. Set to FALSE to do not accept input from
* a file.
* @param file The file path.
* @return None.
*/
public function setInputFromFile($file) {
$this->inputFromFile = $file;
}
/**
* Do not throw an error exception if the command execution fails.
* @param quiet Set to TRUE to do not throw an exception.
* Defaults to TRUE.
* @return None.
*/
public function setQuiet($quiet = TRUE) {
$this->quiet = $quiet;
}
/**
* Execute the command in background. The method \em execute immediatelly
* returns in this case.
* @param background Set to TRUE to do execute the command in background.
* Defaults to TRUE.
* @return None.
*/
public function setBackground($background = TRUE) {
$this->background = $background;
}
/**
* Set an environment variable.
* @param name The name of the environment variable.
* @param value The value of the environment variable.
* @return None.
*/
public function setEnv($name, $value) {
if (1 == func_num_args())
$this->env[] = $name; // Keep backward compatibility.
else
$this->env[] = sprintf("%s=%s", $name, $value);
}
/**
* Get the command line to be executed.
* @return The command line.
*/
public function getCommandLine() {
$cmdArgs = [];
foreach ($this->env as $env)
$cmdArgs[] = sprintf("export %s;", $env);
$cmdArgs = array_merge($cmdArgs, $this->cmdArgs);
if (FALSE === empty($this->redirect1toFile))
$cmdArgs[] = sprintf("1>%s", $this->redirect1toFile);
if (FALSE === empty($this->redirect2toFile))
$cmdArgs[] = sprintf("2>%s", $this->redirect2toFile);
if (FALSE === empty($this->inputFromFile))
$cmdArgs[] = sprintf("<%s", $this->inputFromFile);
if (TRUE === $this->background)
$cmdArgs[] = "&";
return implode(" ", $cmdArgs);
}
/**
* Execute the command.
* @param output If the output argument is present, then the specified
* array will be filled with every line of output from the command.
* @param exitStatus If the argument is present along with the output
* argument, then the return status of the executed command will be
* written to this variable.
* @return The last line from the result of the command.
* @throw \OMV\ExecException
*/
public function execute(array &$output = NULL, &$exitStatus = NULL) {
// Build the command line.
$cmdLine = $this->getCommandLine();
// Execute the command.
$this->debug("Executing command '%s'", $cmdLine);
$result = exec($cmdLine, $output, $exitStatus);
if ((FALSE === $this->quiet) && (0 !== $exitStatus))
throw new \OMV\ExecException($cmdLine, $output, $exitStatus);
return $result;
}
}
root@openmediavault:/usr/share/php/openmediavault/system#