getlogin: Inappropriate ioctl for device

Posted on 2006-05-09
Last Modified: 2013-12-27
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.
Question by:jgourlay
    LVL 20

    Accepted Solution

    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:
    LVL 27

    Assisted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now