When I run the command "unbound-control load_cache < zero_length_file" it hangs.
I put this command in a script that runs when I (re)start unbound, and sometimes the saved cache file is 0 length which causes the script to hang and eventually timeout. I found this out due to a bug in my script that makes it sometimes create a 0 length cache file when I stop unbound. I think this is probably an upstream bug. The program might not check the size of the file it is trying to read to see if it is 0 length.
$ apt policy unbound
unbound:
Installed: 1.17.1-2+deb12u2
Candidate: 1.17.1-2+deb12u2
Version table:
*** 1.17.1-2+deb12u2 500
500 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages
100 /var/lib/dpkg/status
1.17.1-2+deb12u1 500
500 http://deb.debian.org/debian bookworm/main arm64 Packages
Some logs from my scripts... I had to kill the process because it hung.
Jun 09 15:35:59 pi sudo[243166]: user : TTY=pts/0 ; PWD=/usr/local/sbin ; USER=root ; COMMAND=/usr/bin/kill 242995
Jun 09 15:35:59 pi sudo[243166]: pam_unix(sudo:session): session opened for user root(uid=0) by user(uid=1000)
Jun 09 15:35:59 pi load_unbound_cache.sh[242989]: Terminated
Jun 09 15:35:59 pi sudo[243166]: pam_unix(sudo:session): session closed for user root
Jun 09 15:35:59 pi unbound[242985]: [242985:0] error: could not send: Broken pipe
Jun 09 15:35:59 pi unbound[242985]: [242985:0] error: could not send: Broken pipe
Jun 09 15:35:59 pi unbound-cache-load[243170]: Sun Jun 9 03:35:59 PM MDT 2024: FAILED to load cache /usr/local/sbin/load_unbound_cache.sh
Jun 09 15:35:59 pi systemd[1]: unbound-cache-load.service: Deactivated successfully.
Jun 09 15:35:59 pi systemd[1]: Finished unbound-cache-load.service - Unbound Cache Load Service.
I put this command in a script that runs when I (re)start unbound, and sometimes the saved cache file is 0 length which causes the script to hang and eventually timeout. I found this out due to a bug in my script that makes it sometimes create a 0 length cache file when I stop unbound. I think this is probably an upstream bug. The program might not check the size of the file it is trying to read to see if it is 0 length.
$ apt policy unbound
unbound:
Installed: 1.17.1-2+deb12u2
Candidate: 1.17.1-2+deb12u2
Version table:
*** 1.17.1-2+deb12u2 500
500 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages
100 /var/lib/dpkg/status
1.17.1-2+deb12u1 500
500 http://deb.debian.org/debian bookworm/main arm64 Packages
Some logs from my scripts... I had to kill the process because it hung.
Jun 09 15:35:59 pi sudo[243166]: user : TTY=pts/0 ; PWD=/usr/local/sbin ; USER=root ; COMMAND=/usr/bin/kill 242995
Jun 09 15:35:59 pi sudo[243166]: pam_unix(sudo:session): session opened for user root(uid=0) by user(uid=1000)
Jun 09 15:35:59 pi load_unbound_cache.sh[242989]: Terminated
Jun 09 15:35:59 pi sudo[243166]: pam_unix(sudo:session): session closed for user root
Jun 09 15:35:59 pi unbound[242985]: [242985:0] error: could not send: Broken pipe
Jun 09 15:35:59 pi unbound[242985]: [242985:0] error: could not send: Broken pipe
Jun 09 15:35:59 pi unbound-cache-load[243170]: Sun Jun 9 03:35:59 PM MDT 2024: FAILED to load cache /usr/local/sbin/load_unbound_cache.sh
Jun 09 15:35:59 pi systemd[1]: unbound-cache-load.service: Deactivated successfully.
Jun 09 15:35:59 pi systemd[1]: Finished unbound-cache-load.service - Unbound Cache Load Service.
Statistics: Posted by pryodon — Tue Jun 11, 2024 12:15 am