[sane-devel] scanadf --scan-script giving me troubles when used in screen environment
Jelle de Jong
jelledejong at powercraft.nl
Fri Jan 30 00:39:33 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Jelle de Jong wrote:
> Hello everybody,
> I have developed this tool that uses scanadf:
> It is also waiting for sponsoring to be included into debian:
> The tool works fine run from the command line but when trying to
> integrate it with keyboard shortcuts i run into serious trouble. I
> spent a hole day trying to debug it without luck.
> The script called from scanadf closes unexpected when executing a
> command like c44 of convert, i first thought it was a bug in convert
> so i made this bug report, see the attachment for info:
> But then after further testing I had exactly the same issue with c44
> It only happens when my tool is not directly executed form a terminal.
> If i run this from a normal xterm of xfce4-terminal it goes wrong:
> screen -S scanner /usr/bin/pct-scanner-script --config color2 --clean
> /usr/bin/xfce4-terminal --hold --execute /usr/bin/pct-scanner-script
> --config color2
> So its not only with screen i get this issue....
> Both above command result in an unexpected exit of the child script
> used by scanadf.
> I also simplified the script that is called form scanadf but it just
> dies unexpected when called: see: http://debian.pastebin.com/d5f169270
> I am complete lost here, I have been pulling out my remaining hairs
> for this hole day :-(
> I can both duplicate this issue on two different machines one lenny
> and one sid.
> Please help,
> Best regards,
> Jelle de Jong
After more debugging with strace I discovered that the running command
received a SIGHUP  singal, I tried all kind of things like wait,
nohup, disown to keep the script called by scanadf running, but no
luck.  --- SIGHUP (Hangup) @ 0 (0) ---
So I created an evil workaround with file status flags, this seems to
be working well and waits until the child is finished before closing
itself, for the full commit diff see:
I think the scanadf code, that call the process script is kind of
broken, it does not allow for extra arguments (only exported envs) and
it does not allow "nohup /path/of/script --argument $file" as argument.
Beside this the spawning process of scanadf used for the script is
like evil black magic for me ... :-(
It took way to much time to debug this issues, the workaround did not
take so much time though.
Would somebody be willing to take a look at the scanadf code and if
possible enhance it. We can talk about some sort of bounty/reward for
the possible work.
Thanks in advance,
Jelle de Jong
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the sane-devel