mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 18:44:44 +00:00
repair sqlite database in CP after failure, https://forum.opnsense.org/index.php?topic=5744.msg23645#msg23645
This commit is contained in:
parent
83ec429db7
commit
fd2e261fad
@ -33,11 +33,13 @@ import time
|
||||
import syslog
|
||||
import traceback
|
||||
import subprocess
|
||||
sys.path.insert(0, "/usr/local/opnsense/site-python")
|
||||
from lib import Config
|
||||
from lib.db import DB
|
||||
from lib.arp import ARP
|
||||
from lib.ipfw import IPFW
|
||||
from lib.daemonize import Daemonize
|
||||
from sqlite3_helper import check_and_repair
|
||||
|
||||
|
||||
class CPBackgroundProcess(object):
|
||||
@ -192,6 +194,9 @@ def main():
|
||||
""" Background process loop, runs as backend daemon for all zones. only one should be active at all times.
|
||||
The main job of this procedure is to sync the administration with the actual situation in the ipfw firewall.
|
||||
"""
|
||||
# perform integrity check and repair database if needed
|
||||
check_and_repair('/var/captiveportal/captiveportal.sqlite')
|
||||
|
||||
last_cleanup_timestamp = 0
|
||||
bgprocess = CPBackgroundProcess()
|
||||
bgprocess.initialize_fixed()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user