OSX Server

For discussion of topics specific to MythTV on OSX
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: OSX Server

Post by sfatula »

Except my machine (the correct one, doh!) has been up for 6 days and it was not running....
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: OSX Server

Post by sfatula »

So, I did have a small amount of time. Upon reboot, I see:

Code: Select all

Sep 29 23:09:39 localhost com.apple.xpc.launchd[1] (org.mythtv.mythbackend): This service is defined to be constantly running and is inherently inefficient.
Sep 29 23:09:49 localhost com.apple.xpc.launchd[1] (org.mythtv.mythbackend[53]): Service exited with abnormal code: 138
Sep 29 23:09:49 localhost com.apple.xpc.launchd[1] (org.mythtv.mythbackend): Service only ran for 9 seconds. Pushing respawn out by 291 seconds.
That being said, this time, I do find mythbackend is indeed running, even after a reboot. I did not change anything, just rebooted to see what would happen. Strange. Can't seem to repeat. Not sure what to think, but, it did work after this reboot.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: OSX Server

Post by pvr4me »

The first message prompted me to do some searching. Launchd was substantially re-written in OS X 10.10 and the "constantly running and is inherently inefficient" message is a jab at developers to a) adopt the new keywords, and b) only run daemons as and when needed. The first part applies to Myth-via-MacPorts but not the second.

I don't know what the 138 abend code is. I'm assuming it came up after the respawn interval? My backend runs for months at a time without crashing so I can't get too excited about a temporary problem after a reboot.

Craig
Formerly the MacPorts guy.
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: OSX Server

Post by sfatula »

I agree about the message as far as the jab, no doubt. However, I can and do cause mythtv backend to abort fairly often. Recently, it seemed to abort when trying to expire old recordings that were not there, primarily due to a transmitter going down that recordings were scheduled for. This seems to crash mythtv. But, I actually have mythtv do this in the morning when no recordings are ever scheduled anyway, so, there's little impact as it seems to clean itself up.

A code 138 appears to be some sort of resource issue from messages I have found, have not looked at the code or found any doc. I would not worry about that.

I was not sure if I should report the mythbackend crashes somewhere.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: OSX Server

Post by pvr4me »

sfatula wrote:I agree about the message as far as the jab, no doubt. However, I can and do cause mythtv backend to abort fairly often. Recently, it seemed to abort when trying to expire old recordings that were not there, primarily due to a transmitter going down that recordings were scheduled for. This seems to crash mythtv. But, I actually have mythtv do this in the morning when no recordings are ever scheduled anyway, so, there's little impact as it seems to clean itself up.

A code 138 appears to be some sort of resource issue from messages I have found, have not looked at the code or found any doc. I would not worry about that.

I was not sure if I should report the mythbackend crashes somewhere.
Myth absolutely should not crash (or even hang) because a recording file is missing or non-existant. What do you mean you "have mythtv do this in the morning"? Expiration should happen as Myth is recording and nearing the 'hard floor' for free disk space.

Please post mythbackend logs for ANY crash so we can discuss. Also, Console.app should have an OS X crash dump if the backend actually crashed. If appropriate, it is easy enough to file a ticket but the devs need specifics to work with.

Craig
Formerly the MacPorts guy.
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: OSX Server

Post by sfatula »

So, based on what you said, is this an abort? What I see is the backend starting again a number of minutes later, so, presume it aborted. Expiration is done via the API, so, mythtv deletes the old recordings when told to via api call. API call works fine, unless, file does not exist (apparently). myth thinks it exists as I see it (the recording), but you cannot play it. This is due to the source being offline when their transmission antenna broke.

Not sure if the attached log actually represents the abort or not I guess. But, I have seen it die in the past many many times when deleting via the API.

Let me know if this is the correct log file. Otherwise, I might just have to pay closer attention but this is all automated now so I don't really care when it stops running as it's only for a few minutes, and, it's never when it's recording since no maintenance is done during that time.
Attachments
mythbackend.20150930041439.862.log
(146.67 KiB) Downloaded 105 times
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: OSX Server

Post by pvr4me »

sfatula wrote:So, based on what you said, is this an abort? What I see is the backend starting again a number of minutes later, so, presume it aborted. Expiration is done via the API, so, mythtv deletes the old recordings when told to via api call. API call works fine, unless, file does not exist (apparently). myth thinks it exists as I see it (the recording), but you cannot play it. This is due to the source being offline when their transmission antenna broke.

Not sure if the attached log actually represents the abort or not I guess. But, I have seen it die in the past many many times when deleting via the API.

Let me know if this is the correct log file. Otherwise, I might just have to pay closer attention but this is all automated now so I don't really care when it stops running as it's only for a few minutes, and, it's never when it's recording since no maintenance is done during that time.
The log covers 10 minutes and ends with "Received Abort trap: 6". Google says likely means an unhandled exception. Do you have any crash dumps in Console.app?

Are you using Kodi with Myth? I don't know which API you are referring to (Services API? I don't know how to interpret that log--I don't know your client or what it is trying to do or the API it is using.

Craig
Formerly the MacPorts guy.
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: OSX Server

Post by sfatula »

Yes, it is the services API. Where would I find the crash dump so I can look for it?

The two API calls used are:

RemoveRecorded
GetRecordedList

These can be executed in code, or, via command line. Even when executing them from command line, I have killed the backend before, sometimes, but, did not capture the exact reasons at the time. I do this to not fill up the hard drive, I want exactly 7 days of recordings. I do not want 8+.

I am not using Kodi, just myth backend on the Mac.
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: OSX Server

Post by bill6502 »

I do not want 8+.
If you're using the Python script I pasted here: viewtopic.php?f=2&t=972&p=4760#p4760
then change line 159 from default=8 to default=7.

Also, I never tested with orphaned recordings (metadata present, but no recording.) Actually,
as I mentioned, I never used the --wrmi option ('cause I don't have old recordings I want
deleted.) If the Services API call(s) cause an abort, I agree with Craig, they shouldn't.

I've no idea if this works for OSX, but the Wiki I use is:
https://www.mythtv.org/wiki/Debugging#C ... _core_file
leejk
Junior
Posts: 65
Joined: Wed Mar 18, 2015 1:51 am

Re: OSX Server

Post by leejk »

So for me, MythWeb is working. Occasionally though for whatever reason I have to stop and restart mythbackend in order for MythWeb to work. I think OS X server is somehow interfering occasionally. Apple is notorious for screwing with the Unix base that we all know and like.

Have any of you guys upgraded to EL Capitan yet on your myth backend?

thx
gsulshski
Junior
Posts: 46
Joined: Sun Feb 22, 2015 11:36 am
United States of America

Re: OSX Server

Post by gsulshski »

leejk wrote:Ok, I decided to experiment :)

I copied the /opt/dvr/apache2/htdocs/MythWeb directory to the OS X Server web directory: /Library/Server/Web/Data/Sites/Default
I added the MythWeb Include directive to /Library/Server/Web/Config/apache2/httpd_server_app.conf
I modified /Library/Server/Web/Data/Sites/Default/MythWeb/mythweb.conf to reflect the new path locations.
I backed up /Library/Server/Web/Config/php/php.ini to php.ini.org
I copied /opt/dvr/etc/php54/php.ini to /Library/Server/Web/Config/php/php.ini, and merged in the values of the original QS X php.ini version

In the OS X server config app, I turned on web services and php.

I stopped the original MythWeb process using the command from the Macports MythWeb wiki page.

And the screenshot shows as far as I've gotten. Any ideas?
Screen Shot 2015-09-25 at 11.21.28 AM.png

I followed your steps and got the same _www error.

I went into the mythweb directory and did a chown _www:_www to the data directory and then cd into the data directory and did a chown _www:_www to the two directories there

When I did a refresh....it worked !
gsulshski
Junior
Posts: 46
Joined: Sun Feb 22, 2015 11:36 am
United States of America

Re: OSX Server

Post by gsulshski »

I made some modifications to the procedure so that I can have all of the normal web services....wiki, xcode bots, etc working along with Mythweb.
sfatula
Senior
Posts: 163
Joined: Sun Aug 09, 2015 3:51 am
Location: Calera, OK
United States of America

Re: OSX Server

Post by sfatula »

It should be noted that installing via Macports allows a separate instance of Apache (the Macports version) and therefore, it will not interfere with the Mac Apache. To me, it's much cleaner for that reason. But, I already used Macports. So, easy for me to say. Still, I always prefer to not mess with system stuff like Apache that the Mac already runs.
jtravers
Newcomer
Posts: 9
Joined: Fri May 30, 2014 11:20 pm

Re: OSX Server

Post by jtravers »

I found that OS X Server would intercept calls to port 80 even if the web service wasn't enabled. Moving MythWeb to a different port allowed it to coexist peacefully.
Post Reply