我已经在 Archlinux 的 arm box(类似于 raspberry pi)上设置了 sane/scanbd。scanbd 被配置为在scan
按下按钮时从扫描仪扫描页面。直接从命令行运行 scanbd 时一切正常scanbd -d1 -f
。但是,当我将它作为服务(使用systemd)运行时,在扫描开始之前有大约 30-40 秒的延迟(尽管它最终会扫描)。
我已按照本指南安装/配置 scanbd。
我将其保留scanbd.conf
为默认配置。我的test.script
看起来像这样:
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
关于为什么引入大规模延迟的任何想法?
终于想出了一个办法。延迟来自 scanbm.socket 服务。
修复步骤: 1. 禁用套接字:
systemctl stop scanbm.socket
systemctl disable scanbm.socket
除去net
作为从设备/etc/scanbd/sane.d/dll.conf
从 scanbd 服务中删除 scanbm 依赖项:
#/etc/systemd/system/dbus-de.kmux.scanbd.server.service
[Unit]
Description=Scanner button polling Service
[Service]
Type=simple
ExecStart=/usr/sbin/scanbd -f -c /etc/scanbd/scanbd.conf
#ExecReload=?
Environment=SANE_CONFIG_DIR=/etc/scanbd/sane.d
StandardInput=null
StandardOutput=syslog
StandardError=syslog
#NotifyAccess=?
[Install]
WantedBy=multi-user.target
#Also=scanbm.socket <-- comment out this line
Alias=dbus-de.kmux.scanbd.server.service
systemctl restart scanbd
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句