Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to get a command to execute from within my MythTV interface on a Mythbuntu computer.

When I try a test command, touch /home/mythbuntu/test, it doesn't work, and I see this entry in /var/log/mythtv/mythbackend.log:

Jul 19 14:29:35 mythbuntu mythbackend[1863]: W SystemEvent mythsystemevent.cpp:55 (run) MythSystemEventHandler: Command 'touch /home/mythbuntu/test' returned 1

I assume returned 1 means some kind of error status, but a Google search didn't result in anything I could understand.

What does returned 1 mean, and what does it tell me about the command I'm trying to run?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

It is not in the Ubuntu manpage for touch but the exit status for touch are:

  • 0 The touch utility executed successfully and all requested changes were made.
  • >0 An error occurred. The touch utility returned the number of files for which the times could not be successfully modified.

So the 1 is the amount of times touch failed to execute. Most likely you are not using the correct user or group to issue this command with so check user and group permissions of the file you are trying to modify with

ls -l /home/mythbuntu/test

If it is user:group mythtv:mythtv you need to add your user to group mythtv for touch to work.

share|improve this answer
    
Some searching and source-header parsing shows this as "General catch-all for errors" or "Operation not permitted". –  hexafraction Dec 28 '12 at 11:46
  • Commands usually return a non-zero exit code when something has gone wrong.
  • As the mythsystemevent.cpp source shows, the MythTV backend dutifully returns the command's actual exit code if it's non-zero:

    if (result != GENERIC_EXIT_OK)
    LOG(VB_GENERAL, LOG_WARNING, LOC +
    QString("Command '%1' returned %2")
    .arg(m_command).arg(result));
    
  • So returned 1 tells you there was an error, in that the command you tried to run failed with exit code 1
  • To find out what it means with respect to the command, or the cause for failure, you need to look at the documentation for the command.
    • For example, the touch manpage tells you to run info coreutils 'touch invocation' for the complete manual, which in turn concludes with An exit status of zero indicates success, and a nonzero value indicates failure.
    • For more details, see Rinzwind's answer.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.