Hi,
I’m trying to move the pihole database from standard location (/etc/pihole/pihole-FTL.db) to external usb disk (/data/pihole/pihole-FTL.db), where /data is the mount point accordig to my fstab
LABEL=data /data auto defaults,noatime,nofail 0 0
ll /data/pihole/pihole-FTL.db
-rw-r--r-- 1 pihole pihole 28K apr 5 12:45 /data/pihole/pihole-FTL.db
During boot process I see in /var/log/pihole-FTL.log
[2018-04-05 12:36:11.108] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2018-04-05 12:36:11.110] SOCKET_LISTENING: only local
[2018-04-05 12:36:11.110] QUERY_DISPLAY: Show queries
[2018-04-05 12:36:11.110] AAAA_QUERY_ANALYSIS: Hide AAAA queries
[2018-04-05 12:36:11.110] MAXDBDAYS: max age for stored queries is 365 days
[2018-04-05 12:36:11.110] RESOLVE_IPV6: Don't resolve IPv6 addresses
[2018-04-05 12:36:11.110] RESOLVE_IPV4: Resolve IPv4 addresses
[2018-04-05 12:36:11.110] DBINTERVAL: saving to DB file every 300 seconds
[2018-04-05 12:36:11.110] DBFILE: Using /data/pihole/pihole-FTL.db
[2018-04-05 12:36:11.110] MAXLOGAGE: Importing up to 24.0 hours of log data
[2018-04-05 12:36:11.110] Finished config file parsing
[2018-04-05 12:36:11.113] Found no other running pihole-FTL process
[2018-04-05 12:36:11.114] PID of FTL process: 343
[2018-04-05 12:36:12.455] Gravity list entries: 561209
[2018-04-05 12:36:12.455] No blacklist present
[2018-04-05 12:36:12.455] No wildcard blocking list present
[2018-04-05 12:36:12.487] db_init() - Cannot open database (14): unable to open database file
[2018-04-05 12:36:12.487] Creating new (empty) database
[2018-04-05 12:36:12.487] db_create() - SQL error (14): unable to open database file
[2018-04-05 12:36:12.487] Database not available
As you can see the line “db_init() - Cannot open database (14): unable to open database file” is quite explicative.
If I restart the pihole-FTL service, then the db is correctly open:
[2018-04-05 12:37:16.467] Starting config file parsing (/etc/pihole/pihole-FTL.conf)
[2018-04-05 12:37:16.467] SOCKET_LISTENING: only local
[2018-04-05 12:37:16.467] QUERY_DISPLAY: Show queries
[2018-04-05 12:37:16.467] AAAA_QUERY_ANALYSIS: Hide AAAA queries
[2018-04-05 12:37:16.467] MAXDBDAYS: max age for stored queries is 365 days
[2018-04-05 12:37:16.467] RESOLVE_IPV6: Don't resolve IPv6 addresses
[2018-04-05 12:37:16.467] RESOLVE_IPV4: Resolve IPv4 addresses
[2018-04-05 12:37:16.467] DBINTERVAL: saving to DB file every 300 seconds
[2018-04-05 12:37:16.467] DBFILE: Using /data/pihole/pihole-FTL.db
[2018-04-05 12:37:16.467] MAXLOGAGE: Importing up to 24.0 hours of log data
[2018-04-05 12:37:16.467] Finished config file parsing
[2018-04-05 12:37:16.470] Found no other running pihole-FTL process
[2018-04-05 12:37:16.471] PID of FTL process: 2321
[2018-04-05 12:37:17.480] Gravity list entries: 561209
[2018-04-05 12:37:17.480] No blacklist present
[2018-04-05 12:37:17.480] No wildcard blocking list present
[2018-04-05 12:37:17.520] Database initialized
It makes me think that at boot time, the service starts before the disk is mounted. Right? Is there a way to change the order of services?
I’m on a PI3 with version 6.6.
Thanks a lot.