mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
PR review changes
This commit is contained in:
@@ -112,7 +112,7 @@ to get the full error message.
|
|||||||
On CentOS v7 the PostgreSQL server is started with `systemd`.
|
On CentOS v7 the PostgreSQL server is started with `systemd`.
|
||||||
Check if `/usr/lib/systemd/system/httpd.service` contains a line `PrivateTmp=true`.
|
Check if `/usr/lib/systemd/system/httpd.service` contains a line `PrivateTmp=true`.
|
||||||
If so then Apache cannot see the `/tmp/.s.PGSQL.5432` file. It's a good security feature,
|
If so then Apache cannot see the `/tmp/.s.PGSQL.5432` file. It's a good security feature,
|
||||||
so use the [[#PostgreSQL_UNIX_Socket_Location_on_CentOS|preferred solution]]
|
so use the [preferred solution](../appendix/Install-on-Centos-7/#adding-selinux-security-settings).
|
||||||
|
|
||||||
However, you can solve this the quick and dirty way by commenting out that line and then run
|
However, you can solve this the quick and dirty way by commenting out that line and then run
|
||||||
|
|
||||||
|
|||||||
18
lib/cmd.php
18
lib/cmd.php
@@ -196,3 +196,21 @@ function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreError
|
|||||||
fail("pgsql returned with error code ($iReturn)");
|
fail("pgsql returned with error code ($iReturn)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function runWithEnv($cmd, $env)
|
||||||
|
{
|
||||||
|
$fds = array(0 => array('pipe', 'r'),
|
||||||
|
1 => STDOUT,
|
||||||
|
2 => STDERR);
|
||||||
|
$pipes = null;
|
||||||
|
$proc = @proc_open($cmd, $fds, $pipes, null, $env);
|
||||||
|
if (!is_resource($proc)) {
|
||||||
|
fail('unable to run command:' . $cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($pipes[0]); // no stdin
|
||||||
|
|
||||||
|
$stat = proc_close($proc);
|
||||||
|
return $stat;
|
||||||
|
}
|
||||||
|
|||||||
@@ -916,23 +916,6 @@ function passthruCheckReturn($cmd)
|
|||||||
passthru($cmd, $result);
|
passthru($cmd, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function runWithEnv($cmd, $env)
|
|
||||||
{
|
|
||||||
$fds = array(0 => array('pipe', 'r'),
|
|
||||||
1 => STDOUT,
|
|
||||||
2 => STDERR);
|
|
||||||
$pipes = null;
|
|
||||||
$proc = @proc_open($cmd, $fds, $pipes, null, $env);
|
|
||||||
if (!is_resource($proc)) {
|
|
||||||
fail('unable to run command:' . $cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose($pipes[0]); // no stdin
|
|
||||||
|
|
||||||
$stat = proc_close($proc);
|
|
||||||
return $stat;
|
|
||||||
}
|
|
||||||
|
|
||||||
function replace_tablespace($sTemplate, $sTablespace, $sSql)
|
function replace_tablespace($sTemplate, $sTablespace, $sSql)
|
||||||
{
|
{
|
||||||
if ($sTablespace) {
|
if ($sTablespace) {
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ if ($aResult['init-updates']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pg_query($oDB->connection, 'TRUNCATE import_status');
|
pg_query($oDB->connection, 'TRUNCATE import_status');
|
||||||
$sSQL = 'INSERT INTO import_status (lastimportdate, sequence_id, indexed) VALUES(';
|
$sSQL = "INSERT INTO import_status (lastimportdate, sequence_id, indexed) VALUES('";
|
||||||
$sSQL .= "'".$sDatabaseDate."',".$aOutput[0].', true)';
|
$sSQL .= $sDatabaseDate."',".$aOutput[0].', true)';
|
||||||
if (!pg_query($oDB->connection, $sSQL)) {
|
if (!pg_query($oDB->connection, $sSQL)) {
|
||||||
fail('Could not enter sequence into database.');
|
fail('Could not enter sequence into database.');
|
||||||
}
|
}
|
||||||
@@ -428,7 +428,7 @@ if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) {
|
|||||||
$oDB->query($sSQL);
|
$oDB->query($sSQL);
|
||||||
echo date('Y-m-d H:i:s')." Completed index step for $sBatchEnd in ".round((time()-$fCMDStartTime)/60, 2)." minutes\n";
|
echo date('Y-m-d H:i:s')." Completed index step for $sBatchEnd in ".round((time()-$fCMDStartTime)/60, 2)." minutes\n";
|
||||||
|
|
||||||
$sSQL = 'UPDATE import_status SET indexed = true';
|
$sSQL = 'update import_status set indexed = true';
|
||||||
$oDB->query($sSQL);
|
$oDB->query($sSQL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,20 +437,3 @@ if ($aResult['import-osmosis'] || $aResult['import-osmosis-all']) {
|
|||||||
if (!$aResult['import-osmosis-all']) exit(0);
|
if (!$aResult['import-osmosis-all']) exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function runWithEnv($cmd, $env)
|
|
||||||
{
|
|
||||||
$fds = array(0 => array('pipe', 'r'),
|
|
||||||
1 => STDOUT,
|
|
||||||
2 => STDERR);
|
|
||||||
$pipes = null;
|
|
||||||
$proc = @proc_open($cmd, $fds, $pipes, null, $env);
|
|
||||||
if (!is_resource($proc)) {
|
|
||||||
fail('unable to run command:' . $cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose($pipes[0]); // no stdin
|
|
||||||
|
|
||||||
$stat = proc_close($proc);
|
|
||||||
return $stat;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user