Red Hat Bugzilla – Bug 263
Expect fails from cron
Last modified: 2008-05-01 11:37:48 EDT
I have many scripts written in expect to do system
administration type stuff. Scripts that invoke another
program with the 'spawn' command fail with:
failed to get controlling terminal using TIOCSCTTYparent:
sync byte write: broken pipe.
This bug has been assigned to a developer for further review.
Programs run from cron do not have a controlling tty.
You might try redirecting stdin and stdout explicitly to /dev/console
in the cron entry:
x x x x x x myscript < /dev/console > /dev/console