I am getting the following error when running a job from the cron:
stty: tcgetattr failed: No such device (error 19)
I believe this to be because the application is trying to set tty
attributes and the cron does not attach to a tty. I can not change the
call to "tcgetattr" because this is from a precompiled binary. Does
anyone know how I can resolve this problem? TIA.
Matt
ma...@REMOVEpartminer.com <-- remove the REMOVE
Sent via Deja.com http://www.deja.com/
Before you buy.
Well, cron doesn't have a tty, but is there any reason you
can't associate the app with a tty?
binaryapp < /dev/someunusedtty > /dev/someunusedtty ?
It still may not like this for other reasons.
I wonder also if you might be able to use Expect to
advantage here- I'm just thinking out loud; not at all sure,
but I think expect knows how to handle ioctl calls to fool
the app it's running into thinking everything's just as it
should be.. might be worth a peek:
http://www.aplawrence.com/Books/expect.html
--
Tony Lawrence (to...@aplawrence.com)
SCO articles, help, book reviews, tests,
job listings and more : http://www.ApLawrence.com
What release and version of which OS are you running?
What is the binary, and on what release and version of which OS was it
compiled?
--
JP
Does this cause the application to stop running, or is this
just an annoying mesaage (in root's mailbox, I assume).
> Well, cron doesn't have a tty, but is there any reason you
> can't associate the app with a tty?
> binaryapp < /dev/someunusedtty > /dev/someunusedtty ?
> It still may not like this for other reasons.
I'd bet he redirected standard output/input to/from /dev/null in his
cron-job :-) I'm going to attempt to prove it. cron does have a place
to stash stdout and stderr if you don't tell it otherwise (I can't find
any documentation, but I think its those /tmp/crout* files).
# stty ixon ixoff < /dev/null
stty: tcgetattr failed: No such device (error 19)
# stty ixon ixoff < /tmp/foo167
ksh: /tmp/foo167: cannot open
# stty ixon ixoff < /dev/root
stty: tcgetattr failed: Inappropriate I/O control operation (error 25)
# at now + 1 minute
stty ixon ixoff
^D
From root's mailbox:
stty: tcgetattr failed: Inappropriate I/O control operation (error 25)
I was looking for way out of writing a short C program to see what the
effect of calling tcgetattr with an unopened filedes, and I'm in luck;
Your original error message includes the word 'stty'.
An application that shells out to an 'stty' command is poorly
designed (it should just call tc[get|set]attr directly). Are you
sure there isn't a shell-script wrapper that invokes the real binary?
if so, you could fix it in there. If it really does shell out to stty,
copy and edit the binary and change the phrase 'stty' to some
other meaningless four-letter command. Use that copy of the binary
for cron jobs.
-sw