* Fixed a bug in Tools.pm->_set_paths where a path set to '#!not_found!#' was being set (the existing value should have been left alone).
* Fixed some escaping in Log->entry. Also added some additional checks to error more gracefully.
* Created Storage->copy_file() that, well, copies files.
* Fixed Storage->find to not call Log->entry.
* Fixed Storage->make_directory() to only pass the first digit when passed a GID or UID with more that one digit (as can happen with GIDs).
* Updated Storage->write_file() to take 'secure' as a parameter to treat the file contents as containing secure data for logging purposes.
* Created System->check_daemon and ->start_daemon to check and start systemd daemons, as needed.
* Updated scancore-daemon to support running things just once on invocation (effectively run on boot or daemon restart). Call scancore-database. from here.
* Added reading striker.conf to scancore-update-states.
Signed-off-by: Digimer <digimer@alteeve.ca>
die$THIS_FILE." ".__LINE__."; Something not defined in Log->entry; path::exe::logger: [".$an->data->{path}{exe}{logger}."], tag: [".$tag."], 'defaults::log::tag': [".$an->data->{defaults}{'log'}{tag}."], priority_string: [".$priority_string."]\n";
die$THIS_FILE." ".__LINE__."; Log->variables() called without 'level': [".$level."] or Log->level: [".$an->Log->level."] defined from: [$source : $line]\n";
Thismethodcheckstoseeifadaemonisrunningornot.Ifitis,itreturns'C<< 1 >>'.Ifthedaemonisn't running, it returns 'C<<0>>'. If the daemon wasn'tfound,'C<< 2 >>'isreturned.
my$output=$an->System->call({shell_call=>$an->data->{path}{exe}{systemctl}." status ".$daemon.".service; ".$an->data->{path}{exe}{'echo'}." return_code:\$?"});
@ -63,6 +63,9 @@ It also has replacement variables: [#!variable!first!#] and [#!variable!second!#
<keyname="log_0041"><![CDATA[[ Error ] - The module Storage->write_file() was asked to write the file: [#!variable!file!#] but it is not a full path. Aborting.]]></key>
<keyname="log_0041"><![CDATA[[ Error ] - The module Storage->write_file() was asked to write the file: [#!variable!file!#] but it is not a full path. Aborting.]]></key>
<keyname="log_0042"><![CDATA[[ Error ] - The module Words->string() was asked to process the string: [#!variable!string!#] which has insertion variables, but nothing was passed to the 'variables' parameter.]]></key>
<keyname="log_0042"><![CDATA[[ Error ] - The module Words->string() was asked to process the string: [#!variable!string!#] which has insertion variables, but nothing was passed to the 'variables' parameter.]]></key>
<keyname="log_0043"><![CDATA[[ Error ] - The module System->call() was called but 'shell_call' was not passed or was empty.]]></key>
<keyname="log_0043"><![CDATA[[ Error ] - The module System->call() was called but 'shell_call' was not passed or was empty.]]></key>
<keyname="log_0044"><![CDATA[[ Error ] - The module Storage->copy_file() was called but 'source' was not passed or was empty.]]></key>
<keyname="log_0045"><![CDATA[[ Error ] - The module Storage->copy_file() was called but 'target' was not passed or was empty.]]></key>
<keyname="log_0046"><![CDATA[[ Error ] - The module Storage->copy_file() was asked to copy: [#!variable!source!#] to: [#!variable!target!#], but the target already exists and 'overwrite' wasn't specified, so aborting.]]></key>
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->
@ -30,6 +30,28 @@ This is the AN::Tools master 'words' file.
<keyname="js_0002">Down</key>
<keyname="js_0002">Down</key>
<keyname="js_0003">Mbps</key>
<keyname="js_0003">Mbps</key>
<!-- Errors -->
<keyname="error_0001">[ Error ] - There is a local database defined, but it does not appear to exist and we could not initialize the database server. Is 'postgresql-server' installed?</key>
<keyname="error_0002">[ Error ] - Failed to start the Postgres server. Please check the system logs for details.</key>
<keyname="error_0003">[ Error ] - There is no ScanCore database user set for the local machine. Please check: [#!data!path::config::striker.conf!#]'s DB entry: [#!variable!id!#].</key>
<keyname="error_0004">[ Error ] - Failed to add the database user: [#!variable!user!#]! Unable to proceed.</key>
<keyname="error_0005">[ Error ] - Failed to create the ScanCore database: [#!variable!database!#]</key>