[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1105
  • Last Modified:

getlogin: Inappropriate ioctl for device

As part of New Payroll system implementation, we have a problem starting the server process using cron. The following error message appears

Your "cron" job on stolly

produced the following output:

getlogin: Inappropriate ioctl for device

Running the process from the command line works fine.
2 Solutions
The following link shows a very similar problem:

Even if this isn't a Python program, the principle remains the same - the "getlogin" function appears to be expecting keyboard input (or at least for a keyboard to be attached) and fails when it can't read from an "appropriate" device.  I presume that the startup process then fails? (Otherwise it would just be a curiosity, rather than a problem ;-)

If this _is_ a Python program, you may get useful advice here:
Your program is not intended for running from cron. Cron jobs have no controlling terminal. Manual page 'man getlogin' says:

If getlogin()  is  called  within  a  process  that  is  not
     attached  to  a  terminal,  it  returns  a null pointer. The
     correct procedure for determining the login name is to  call
     cuserid(3C),  or  to call getlogin() and if it fails to call


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now