hostwatch db grows rapidly

Started by astrandb, January 30, 2026, 10:37:29 AM

Previous topic - Next topic
Just to be sure we're going to reinstall the correct hostwatch, restart it and check:

# pkg add -f https://pkg.opnsense.org/FreeBSD:14:amd64/26.1/MINT/26.1_4/latest/All/hostwatch-1.0.11.pkg
# service hostwatch restart
# ls -lah /var/db/hostwatch


Cheers,
Franco

For reference on my end:

# ls -lah /var/db/hostwatch
total 36949
drwxr-x---   2 hostd hostd    5B Jan 26 10:28 .
drwxr-xr-x  23 root  wheel   31B Feb  3 15:19 ..
-rw-r-----   1 hostd hostd  9.2M Feb  3 15:26 hosts.db
-rw-r-----   1 hostd hostd  320K Jan 31 15:59 hosts.db-shm
-rw-r-----   1 hostd hostd  128M Feb  3 15:37 hosts.db-wal

QuoteJust to be sure we're going to reinstall the correct hostwatch, restart it and check:

# pkg add -f https://pkg.opnsense.org/FreeBSD:14:amd64/26.1/MINT/26.1_4/latest/All/hostwatch-1.0.11.pkg
# service hostwatch restart
# ls -lah /var/db/hostwatch


Cheers,
Franco

Thank you for the info. I ran all the commands with results below. Not sure it it may take a while to cleanup the database or not.

root@firewall:#  pkg add -f https://pkg.opnsense.org/FreeBSD:14:amd64/26.1/MINT/26.1_4/latest/All/hostwatch-1.0.11.pkg
Fetching hostwatch-1.0.11.pkg: 100%    1 MiB   1.4MB/s    00:01   
Installing hostwatch-1.0.11...
package hostwatch is already installed, forced install
===> Creating groups
Using existing group 'hostd'
===> Creating users
Using existing user 'hostd'
Extracting hostwatch-1.0.11: 100%


root@firewall:# service hostwatch restart
hostwatch not running? (check /var/run/hostwatch/hostwatch.pid).
Starting hostwatch.


root@firewall: # ls -lah /var/db/hostwatch/
total 70972059
drwxr-xr-x   2 hostd hostd    5B Jan 29 08:20 .
drwxr-xr-x  25 root  wheel   35B Feb  3 09:28 ..
-rw-r--r--   1 hostd hostd  4.1M Feb  3 09:45 hosts.db
-rw-r--r--   1 hostd hostd   40M Feb  3 09:46 hosts.db-shm
-rw-r--r--   1 hostd hostd  1.0T Feb  2 07:53 hosts.db-wal

So the hostwatch pid file doesn't work I guess.

# pkill hostwatch && service hostwatch start


Cheers,
Franco

Quote from: franco on February 03, 2026, 03:54:43 PMSo the hostwatch pid file doesn't work I guess.

# pkill hostwatch && service hostwatch start


Cheers,
Franco

root@firewall:# pkill hostwatch && service hostwatch start
hostwatch already running?  (pid=37932).

root@firewall:# ps aux | grep hostwatch
root     49557   0.0  0.0   13744  2012  0  S+   10:01     0:00.00 grep hostwatch

root@firewall:# service hostwatch start
Starting hostwatch.

root@firewall:# ps aux | grep hostwatch
hostd    51113  39.4  0.2   70356 16352  -  R    10:01     0:04.91 /usr/local/bin/hostwatch -p -c -S -P /var/run/hostwatch/hostwatch.pid -d /var/db/hostwatch

root@firewall:# ll -lah /var/db/hostwatch/
total 70972059
drwxr-xr-x   2 hostd hostd    5B Jan 29 08:20 ./
drwxr-xr-x  25 root  wheel   35B Feb  3 09:28 ../
-rw-r--r--   1 hostd hostd  4.1M Feb  3 10:01 hosts.db
-rw-r--r--   1 hostd hostd  166M Feb  3 10:03 hosts.db-shm
-rw-r--r--   1 hostd hostd  1.0T Feb  2 07:53 hosts.db-wal


When you have stopped it try to remove the extra files named hosts.db-* and restart.

Very odd case.


Cheers,
Franco

Quote from: franco on February 03, 2026, 04:14:46 PMWhen you have stopped it try to remove the extra files named hosts.db-* and restart.

Very odd case.


Cheers,
Franco

That seemed to do it, thank you very much.

root@firewall:/var/db/hostwatch # ls -lah
total 10631
drwxr-xr-x   2 hostd hostd    5B Feb  3 10:26 .
drwxr-xr-x  25 root  wheel   35B Feb  3 09:28 ..
-rw-r--r--   1 hostd hostd  4.1M Feb  3 10:27 hosts.db
-rw-r--r--   1 hostd hostd  256K Feb  3 10:27 hosts.db-shm
-rw-r--r--   1 hostd hostd  119M Feb  3 10:27 hosts.db-wal