--- /dev/null
+default[:nominatim][:logdir] = "/var/log/nominatim"
database database_name
end
-directory "/var/log/nominatim" do
+directory node[:nominatim][:logdir] do
owner "nominatim"
group "nominatim"
mode 0755
+ recursive true
+end
+
+file "#{node[:nominatim][:logdir]}/query.log" do
+ action :create_if_missing
+ owner "www-data"
+ group "adm"
+ mode 0664
+end
+
+file "#{node[:nominatim][:logdir]}/update.log" do
+ action :create_if_missing
+ owner "nominatim"
+ group "adm"
+ mode 0664
end
directory "#{home_directory}/status" do
user "nominatim"
end
-directory "#{source_directory}/log" do
- owner "nominatim"
- group "nominatim"
- mode 0755
-end
-
template "#{source_directory}/.git/hooks/post-merge" do
source "update_source.erb"
owner "nominatim"
-LOGFILE='/var/log/nominatim/restricted_ips.log'
+LOGFILE='<%= node[:nominatim][:logdir] %>/restricted_ips.log'
# space-separated list of IPs that are never banned
WHITELIST = ''
# space-separated list of IPs manually blocked
# DO NOT EDIT - This file is being maintained by Chef
-/var/log/nominatim/update.log {
+<%= node[:nominatim][:logdir] %>/update.log {
weekly
missingok
rotate 5
create 640 nominatim adm
}
-/var/log/nominatim/query.log {
+<%= node[:nominatim][:logdir] %>/query.log {
weekly
missingok
rotate 8
user www-data
env.PGDATABASE <%= node[:nominatim][:database][:dbname] %>
env.PGUSER www-data
-env.NOMINATIM_QUERYLOG /var/log/nominatim/query.log
+env.NOMINATIM_QUERYLOG <%= node[:nominatim][:logdir] %>/query.log
@define('CONST_Tablespace_<%= part %>', '<%= name %>');
<% end -%>
-@define('CONST_Log_File', '/var/log/nominatim/query.log');
+@define('CONST_Log_File', '<%= node[:nominatim][:logdir] %>/query.log');
@define('CONST_Log_DB', false);
while [ ! -f "<%= @update_stop_file %>" ]
do
# Send output to the log (logrotatable)
- exec >> /var/log/nominatim/update.log 2>&1
+ exec >> <%= node[:nominatim][:logdir] %>/update.log 2>&1
starttime=`date +%s`
./utils/update.php --no-npi --import-osmosis
:nominatim => {
:enabled => false,
:flatnode_file => "/ssd/nominatim/nodes.store",
+ :logdir => "/ssd/nominatim/log",
:database => {
:cluster => "9.4/main",
:dbname => "nominatim",