[mythtv-users] OS X Installer Updated - March 2015

Craig Treleaven ctreleaven at cogeco.ca
Sun Mar 22 14:49:08 UTC 2015


At 10:02 AM -0400 3/22/15, George Nassas wrote:
>On Mar 22, 2015, at 7:33 AM, Craig Treleaven 
><<mailto:ctreleaven at cogeco.ca>ctreleaven at cogeco.ca> wrote:
>
>>
>>Um, launchd won't start a backend unless you tell it to!  Both the 
>>Myth_Stop_Start helper and 'port load mythtv-core.27' are shortcuts 
>>to the 'sudo launchctl load -w 
>>/Library/LaunchDaemons/org.mythtv.mythbackend.plist'.  The plist, 
>>by itself, doesn't do anything.  The user determines if launchd is 
>>to run the process or not.
>>
>
>Well, looking at 
><http://macports.mirror.ac.za/release/ports/multimedia/mythtv-core.27/files/org.mythtv.mythbackend.plist>http://macports.mirror.ac.za/release/ports/multimedia/mythtv-core.27/files/org.mythtv.mythbackend.plist I 
>see:
>
>     <key>RunAtLoad</key>
>     <true/>
>
>and
>
>     <key>KeepAlive</key>
>     <true/>
>
>so if the file is in /Library/LaunchDaemons it's definitely going to 
>do something at load and also on each boot.

Sorry, no.  Those keys are there, but one HAS to use launchctl to 
load a job definition; launchd only starts jobs that launchctl has 
told it to.  See Myth_Stop_Start:

https://trac.macports.org/browser/trunk/dports/multimedia/mythtv-core.27/files/Myth_Stop_Start.applescript

The command to load the backend daemon is at line 76 -
sudo launchctl load -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist

The unload command is at line 58 -
sudo launchctl unload -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist

Similarly, the pair of commands to cause log rotation to be run daily 
are at lines 87 and 67 -
sudo launchctl load -w /Library/LaunchDaemons/org.macports.logrotate.plist
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.logrotate.plist

The plist files always sit in '/Library/LaunchDaemons/' but don't do 
anything until the 'launchctl load ...' command.

I have yet to find good, basic documentation of launchctl/launchd. 
It is one of those things where you have to understand how it works 
before you can understand the documentation of how to work it!  There 
is a web site with half-decent examples of the various keys and how 
one might use them:

http://launchd.info/

>It did when I installed it around the time you first announced the 
>port. RunAtLoad false would work for me but probably not everyone 
>else so no reason to change. I can edit the config to not run at 
>load but macports will reset that on each update. I have a similar 
>problem with nginx where I want the launchd to use my parameters but 
>macports would keep overwriting my changes.

The current setup for nginx does not automatically get loaded when 
the port is installed.  When installing the port (talking about nginx 
conf files) it specifically says "Adjust these files to your needs 
before starting nginx."  Maybe it was different in the past.

>Anyway the news about local portfiles is great, I'll have a go 
>sometime in the next few months.

Cool.  I may well create a 'mythtv-core-devel' port for building 
master.  If so, I probably won't update it any more frequently than 
every couple of weeks.  Depends how straightforward it is to 
build...I'll announce here if I do so.

Craig



More information about the mythtv-users mailing list