* Fixed the path of anvil.sql

* Set Log->entry to chmod the log file to 666 when the file is opened to ensure apache can write to it.
* Fixed a string replacement variable name.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 7 years ago
parent eae72ad582
commit 2c52f649ba
  1. 2
      Anvil/Tools.pm
  2. 3
      Anvil/Tools/Log.pm
  3. 9
      rpm/SPECS/anvil.spec
  4. 2
      share/words.xml
  5. 1
      tools/anvil-prep-database

@ -916,7 +916,7 @@ sub _set_paths
postgres_pgpass => "/var/lib/pgsql/.pgpass",
},
sql => {
'anvil.sql' => "/usr/sbin/anvil.sql",
'anvil.sql' => "/usr/share/anvil/anvil.sql",
},
urls => {
skins => "/skins",

@ -326,6 +326,9 @@ sub entry
open (my $file_handle, ">>", $shell_call) or die "Failed to open: [$shell_call] for writing. The error was: $!\n";
$file_handle->autoflush(1);
$anvil->{HANDLE}{log_file} = $file_handle;
# Make sure it can be written to by apache.
$anvil->Storage->change_mode({target => $log_file, mode => "0666"});
}
if (not $anvil->{HANDLE}{log_file})

@ -3,7 +3,7 @@
%define anvilgroup admin
Name: anvil
Version: 3.0
Release: 7%{?dist}
Release: 8%{?dist}
Summary: Alteeve Anvil! complete package.
License: GPLv2+
@ -286,7 +286,7 @@ cp -R -p tools/* %{buildroot}/%{_sbindir}
cp -R -p anvil.conf %{buildroot}/%{_sysconfdir}/anvil/
cp -R -p anvil.version %{buildroot}/%{_sysconfdir}/anvil/
cp -R -p share/* %{buildroot}/%{_usr}/share/anvil/
mv %{buildroot}/%{_sbindir}/anvil.sql %{buildroot}/%{_datadir}/anvil.sql
mv %{buildroot}/%{_sbindir}/anvil.sql %{buildroot}/%{_datadir}/anvil/anvil.sql
%pre core
@ -344,7 +344,7 @@ systemctl stop postgresql.service
%files core
%doc README.md notes
%config(noreplace) %{_sysconfdir}/anvil/anvil.conf
%config(noreplace) %{_datadir}/anvil.sql
%config(noreplace) %{_datadir}/anvil/anvil.sql
%{_usr}/lib/*
%{_usr}/share/anvil/*
%{_sbindir}/*
@ -363,6 +363,9 @@ systemctl stop postgresql.service
%changelog
* Thu Jul 13 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-8
- Fixed the path to anvil.sql
* Thu Jul 12 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-7
- Added an explicit call to anvil-prep-database in post.

@ -185,7 +185,7 @@ The database connection error was:
<key name="log_0092"><![CDATA[[ Error ] - Unable to connect to the database: [#!variable!server!#] (id: [#!variable!uuid!#]).]]></key>
<key name="log_0093"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'modified_date' parameter was not passed and/or 'sys::db_timestamp' is not set. Did the program fail to connect to any databases?]]></key>
<key name="log_0094">[ Error ] - Failed to start the Postgres server. Please check the system logs for details.</key>
<key name="log_0095">The database user: [#!variable!user!#] was created with ID: [#!variable!uuid!#].</key>
<key name="log_0095">The database user: [#!variable!user!#] was created with ID: [#!variable!id!#].</key>
<key name="log_0096">[ Error ] - Failed to add the database user: [#!variable!user!#]! Unable to proceed.</key>
<key name="log_0097"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'set' parameter was not passed or it is empty. It should be 'set' or 'clear'.]]></key>
<key name="log_0098">

@ -283,6 +283,7 @@ if ($local_uuid)
}
# Update/set the passwords.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, secure => 1, list => { "database::${local_uuid}::password" => $anvil->data->{database}{$local_uuid}{password} }});
if ($anvil->data->{database}{$local_uuid}{password})
{
foreach my $user ("postgres", $database_user)

Loading…
Cancel
Save