"tcsetattr(): Inappropriate ioctl for device" (redirection to /dev/null)

Nils Kassube kassube at gmx.net
Thu Apr 23 18:04:50 UTC 2015


Adam Funk wrote:
> On 2015-04-07, Nils Kassube wrote:
> > Adam Funk wrote:
> >> I have a cron job to run a bash script that includes the following
> >> line:
> >> 
> >> hpodder  >/dev/null
> >> 
> >> Note that I'm not redirecting stderr.  Whenever the hpodder command
> >> gives an error message, the cron job output also includes
> >> "tcsetattr(): Inappropriate ioctl for device".  I've googled this
> >> message & it usually seems related to redirecting output when
> >> changing ownership/permissions, e.g., with su -c or sudo.  In my
> >> case, the crontab is running in the 'adam' account, & the bash
> >> script is owned by 'adam' too.
> > 
> > The tcsetattr function is usually used for some sort of terminal
> > device. Maybe that script wants to change the terminal settings of
> > /dev/null which wouldn't make sense. What happens if you try the
> > command from the command line instead of the cron job? Do you also
> > get the error message? And what is the purpose of the script?
> 
> It runs hpodder, which is an obsolete command-line podcast-fetching
> program (I've been looking for a replacement, but I couldn't get
> podget to work) properly.  The cron job runs it in the morning before
> I get to the office.

Thanks for clarifying. I found a deb package for hpodder but it wouldn't 
install due to missing dependencies. So I couldn't find out why it 
prints the error message.

Anyway, you didn't answer the question if you also get the error message 
if you run hpodder from the command line instead of the cron job. That 
would be a way to find out if the hpodder command really is the culprit. 
In your initial message you mentioned that you have a bash script which 
is run from cron. That reminds me that cron doesn't run bash but dash as 
shell, so maybe you really need bash for your script. Then you could run 
it from cron with the command

bash -c your_script

OTOH, I think it would be better to make podget work for you. Perhaps 
someone else on this list knows that program and can help you. I read 
the man page and to me it seems not to be too complicated.


Nils





More information about the ubuntu-users mailing list