* Moved words.xml to /usr/share/anvil/

* Moved all executables to /usr/sbin/
* Made /root/anvil-backups/ the backup directory.
* Started debuging anvil-prep-database

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 7 years ago
parent d03213b860
commit d864bd6dac
  1. 14
      Anvil/Tools.pm
  2. 7
      journald.conf.d/anvil.conf
  3. 0
      share/words.xml
  4. 11
      tools/anvil-prep-database

@ -699,7 +699,7 @@ sub _set_paths
$anvil->data->{path} = {
configs => {
'firewalld.conf' => "/etc/firewalld/firewalld.conf",
'journald_an' => "/etc/systemd/journald.conf.d/an.conf",
'journald_anvil' => "/etc/systemd/journald.conf.d/anvil.conf",
'pg_hba.conf' => "/var/lib/pgsql/data/pg_hba.conf",
'postgresql.conf' => "/var/lib/pgsql/data/postgresql.conf",
ssh_config => "/etc/ssh/ssh_config",
@ -711,18 +711,18 @@ sub _set_paths
passwd => "/etc/passwd",
},
directories => {
backups => "/usr/sbin/anvil/backups",
backups => "/root/anvil-backups",
'cgi-bin' => "/var/www/cgi-bin",
firewalld_services => "/usr/lib/firewalld/services",
firewalld_zones => "/etc/firewalld/zones",
html => "/var/www/html",
skins => "/var/www/html/skins",
tools => "/usr/sbin/anvil",
tools => "/usr/sbin",
units => "/usr/lib/systemd/system",
},
exe => {
'anvil-prep-database' => "/usr/sbin/anvil/anvil-prep-database",
'anvil-update-states' => "/usr/sbin/anvil/anvil-update-states",
'anvil-prep-database' => "/usr/sbin/anvil-prep-database",
'anvil-update-states' => "/usr/sbin/anvil-update-states",
'anvil-report-memory' => "/usr/sbin/anvil-report-memory",
'chmod' => "/usr/bin/chmod",
'chown' => "/usr/bin/chown",
@ -762,13 +762,13 @@ sub _set_paths
network_interfaces => "/sys/class/net",
},
sql => {
'anvil.sql' => "/usr/sbin/anvil/anvil.sql",
'anvil.sql' => "/usr/sbin/anvil.sql",
},
urls => {
skins => "/skins",
},
words => {
'words.xml' => "/usr/sbin/anvil/words.xml",
'words.xml' => "/usr/share/anvil/words.xml",
},
};

@ -0,0 +1,7 @@
# This disables the rate limiting so that when log level is set to 3, log
# entries aren't lost. If you want to override this, don't delete the file,
# just comment out the lines below.
[Journal]
RateLimitInterval=0
RateLimitBurst=0

@ -30,6 +30,11 @@ my $anvil = Anvil::Tools->new();
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 1});
# Read switches
$anvil->Get->switches;
die $THIS_FILE." ".__LINE__."; log level: [".$anvil->Log->level."]\n";
# Paths
$anvil->data->{path}{config}{'striker.conf'} = "/etc/anvil/anvil.conf";
$anvil->Storage->read_config({file => $anvil->data->{path}{config}{'striker.conf'}});
@ -328,7 +333,7 @@ if ($local_id)
# Log level 3 creates so much logging that it hits journald's rate limiting (1000 logs per 30
# seconds). So we need to disable it.
if (not -e $anvil->data->{path}{configs}{'journald_an'})
if (not -e $anvil->data->{path}{configs}{'journald_anvil'})
{
# Write the file to disable journald rate limiting.
my $body = "# This disables the rate limiting so that when log level is set to 3, log
@ -340,14 +345,14 @@ RateLimitInterval=0
RateLimitBurst=0
";
$anvil->Storage->write_file({
file => $anvil->data->{path}{configs}{'journald_an'},
file => $anvil->data->{path}{configs}{'journald_anvil'},
body => $body,
user => "root",
group => "root",
mode => "0644",
overwrite => 0,
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "message_0012", variables => { file => $anvil->data->{path}{configs}{'journald_an'} }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "message_0012", variables => { file => $anvil->data->{path}{configs}{'journald_anvil'} }});
my $shell_call = $anvil->data->{path}{exe}{systemctl}." restart systemd-journald.service";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { shell_call => $shell_call }});

Loading…
Cancel
Save