Exit status 78?
Added by Eric Westbrook over 7 years ago
After upgrading to latest git (bee6788f3), tvheadend exits with status 78 for me. Can anyone help me understand what this means?
Thanks,
Festive
Replies (5)
RE: Exit status 78? - Added by Mark Clarkstone over 7 years ago
Without a log, no. Check your syslog.
RE: Exit status 78? - Added by Eric Westbrook over 7 years ago
Nothing was written to the syslog during those attempts. Nothing. Sorry, I should have said that. In any case, I think I've solved my problem independently. So thanks anyway.
But my actual (and unanswered) question remains: What is tvheadend actually trying to say by exiting with status 78?
Indeed, what does any non-zero-or-one exit status from tvheadend indicate?
I ask, because, presumably, tvheadend is trying to be helpful and indicative by using a status other than "0" or "1". It would be useful to be able to understand that helpfulness directly. The man page does not list exit status codes, even though that's a good linux man page practice.
I'd be happy to offer a patch to the man page, if I could learn what the possible exit status codes and their meanings are.
Does anyone has a list of possible tvheadend exit status codes and their meanings?
Thanks again,
F
RE: Exit status 78? - Added by Mark Clarkstone over 7 years ago
I looked through the code for exit() statements and found where 78 drops. Source
It appears to be a locking error.
RE: Exit status 78? - Added by Eric Westbrook over 7 years ago
VERY helpful! Thanks! Definitely set me on the right road there. Appreciate it.
I've started some man page editing here
I've also discovered why I didn't see any log messages.
Log messages are indeed being queued here, but there's no flush of that queue before exit() is called, which means that tvhlog_process() is never actually called to output the messages.
I confirmed this by undefining TVHLOG_THREAD here after which I can see the messages when this error is triggered. But I assume it's better to flush the queue before exit, rather than defeating the log threading entirely.
What's the "proper" call to flush that queue, then? Should I do so directly before the exit(78), or would it be better to create a new wrapper for exit(), which flushes that queue first, that other callers of exit() can use for the same benefit?
I'd like to fix it the "right" way, whichever that should be.
Thanks again! Advice appreciated.
PS - Updated my name, too.
RE: Exit status 78? - Added by Mark Clarkstone over 7 years ago
Eric Westbrook wrote:
VERY helpful! Thanks! Definitely set me on the right road there. Appreciate it.
I've started some man page editing here
I've also discovered why I didn't see any log messages.
Log messages are indeed being queued here, but there's no flush of that queue before exit() is called, which means that tvhlog_process() is never actually called to output the messages.
I confirmed this by undefining TVHLOG_THREAD here after which I can see the messages when this error is triggered. But I assume it's better to flush the queue before exit, rather than defeating the log threading entirely.
What's the "proper" call to flush that queue, then? Should I do so directly before the exit(78), or would it be better to create a new wrapper for exit(), which flushes that queue first, that other callers of exit() can use for the same benefit?
I'd like to fix it the "right" way, whichever that should be.
Thanks again! Advice appreciated.
PS - Updated my name, too.
I'm no C dev (I'm more a PHP/Python guy), so mostly just guess how the code works. You however appear to understand it a lot more than I do. If you can, please do consider PRing any improvements to Tvheadend. The more people working on it, the better it gets for everyone!