|
@@ -536,6 +536,10 @@ f_deltemp()
|
536
|
536
|
#
|
537
|
537
|
f_remove()
|
538
|
538
|
{
|
|
539
|
+ local query_pid
|
|
540
|
+ local query_date
|
|
541
|
+ local query_total
|
|
542
|
+ local query_blocked
|
539
|
543
|
if [ "${query_ok}" = "true" ] && [ "${ntp_ok}" = "true" ]
|
540
|
544
|
then
|
541
|
545
|
query_date="$(date "+%Y%m%d")"
|
|
@@ -547,20 +551,23 @@ f_remove()
|
547
|
551
|
fi
|
548
|
552
|
if [ -s "${adb_querypid}" ] && [ ! -f "${adb_queryfile}.${query_date}" ]
|
549
|
553
|
then
|
550
|
|
- kill -9 "$(cat "${adb_querypid}")" >/dev/null 2>&1
|
|
554
|
+ query_pid="$(cat "${adb_querypid}" 2>/dev/null)"
|
|
555
|
+ > "${adb_querypid}"
|
|
556
|
+ kill -9 "${query_pid}" >/dev/null 2>&1
|
551
|
557
|
rc=${?}
|
552
|
558
|
if [ $((rc)) -eq 0 ]
|
553
|
559
|
then
|
554
|
560
|
find "${adb_backupdir}" -maxdepth 1 -type f -mtime +"${adb_queryhistory}" -name "${query_name}.*" -exec rm -f "{}" \; 2>/dev/null
|
555
|
561
|
rc=${?}
|
556
|
|
- fi
|
557
|
|
- if [ $((rc)) -eq 0 ]
|
558
|
|
- then
|
559
|
|
- f_log "remove old domain query log background process (pid: $(cat "${adb_querypid}")) and do logfile housekeeping"
|
|
562
|
+ if [ $((rc)) -eq 0 ]
|
|
563
|
+ then
|
|
564
|
+ f_log "remove old domain query background process (pid: ${query_pid}) and do logfile housekeeping"
|
|
565
|
+ else
|
|
566
|
+ f_log "error during domain query logfile housekeeping" "${rc}"
|
|
567
|
+ fi
|
560
|
568
|
else
|
561
|
|
- f_log "error during domain query removal/housekeeping (pid: $(cat "${adb_querypid}"))" "${rc}"
|
|
569
|
+ f_log "error during domain query background process removal (pid: ${query_pid})" "${rc}"
|
562
|
570
|
fi
|
563
|
|
- > "${adb_querypid}"
|
564
|
571
|
fi
|
565
|
572
|
if [ ! -s "${adb_querypid}" ]
|
566
|
573
|
then
|
|
@@ -569,9 +576,9 @@ f_remove()
|
569
|
576
|
if [ $((rc)) -eq 0 ]
|
570
|
577
|
then
|
571
|
578
|
sleep 1
|
572
|
|
- f_log "new domain query log background process started (pid: $(cat "${adb_querypid}"))"
|
|
579
|
+ f_log "new domain query log background process started (pid: $(cat "${adb_querypid}" 2>/dev/null))"
|
573
|
580
|
else
|
574
|
|
- f_log "error during domain query start" "${rc}"
|
|
581
|
+ f_log "error during domain query background process start" "${rc}"
|
575
|
582
|
fi
|
576
|
583
|
fi
|
577
|
584
|
fi
|