Jérémy Lal:
>> Hello Ximin,
>>
>> i tried your patch, and now when interrupting using ctrl-c
>> xvfb-run -a myapp
>> i get (i added the "cleaning" message):
>>
>> ^Ccleaning /tmp/xvfb-run.UlOS0T
>> cleaning /tmp/xvfb-run.UlOS0T
>> rm: cannot remove '/tmp/xvfb-run.UlOS0T': No such file or directory
>> xvfb-run: error: problem while cleaning up temporary directory
>>
>> obviously cleanup is run twice.
>>
I couldn't figure out why it is run twice [*], but if you just change "rm -r" to "rm -rf" it will no longer fail. I don't see any problem with that.
Updated patch attached, I also updated the signals (added some more, removed KILL since it doesn't actually work) and added some quoting.
X
[*] Ctrl-C sends SIGINT to the whole process group, so I tried with "kill" specifically to the shell running xvfb but it still double-cleaned. I also tried "trap clean_up <signals>" omitting EXIT and adding "clean_up" before "exit" at the bottom of the script but that didn't fix the double-clean either.