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

x
  • 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
/cyborghome/app/server/cas

produced the following output:

getlogin: Inappropriate ioctl for device


Running the process from the command line works fine.
0
jgourlay
Asked:
jgourlay
2 Solutions
 
tfewsterCommented:
The following link shows a very similar problem:
http://mail.python.org/pipermail/python-dev/2003-February/033547.html

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:
http://www.experts-exchange.com/Programming/Programming_Languages/Python/
0
 
NopiusCommented:
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
     getpwuid(3C).

0

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