I've set up sane/scanbd on an arm box (similar to raspberry pi) with Archlinux. The scanbd is configured to scan a page from the scanner when the scan
button is pressed. Everything works fine when running scanbd directly from command line as scanbd -d1 -f
. However, when I run it as a service (with systemd), there's a delay of about 30-40s before scanning starts (although it scans eventually).
I've followed this guide to install/configure scanbd.
I left the scanbd.conf
as the default configuration. My test.script
looks like this:
scanimage --batch-count=1 --resolution 150 --source="ADF Duplex" --batch=/tmp/$(date +%Y%m%d_%H%M)_%02d_out.tiff --format=tiff
#merge into multipage tiff
tiffcp -c lzw /tmp/*out.tiff /tmp/output.tiff
#convert to pdf
tiff2pdf -z /tmp/output.tiff > /tmp/output.pdf
rm /tmp/*.tiff
chmod 755 /tmp/output.pdf
mv /tmp/output.pdf /home/scanner/output.pdf
Any ideas as to why the massive delay is introduced?
Finally figured out a workaround. The delay comes from scanbm.socket service.
Steps to fix: 1. disable the socket:
remove
net
as the device from/etc/scanbd/sane.d/dll.conf
remove scanbm dependency from the scanbd service:
systemctl restart scanbd