Re: “Executable” StartupItems are preferred over “script” StartupItems

macports at parvis.nl macports at parvis.nl
Tue May 15 18:57:19 UTC 2018


> On 2018-05-15, at 03:56, Ryan Schmidt <ryandesign at macports.org> wrote:
> 
> 
> On May 14, 2018, at 11:13, macports at parvis.nl wrote:
> 
>> The Guide states “Executable” StartupItems are preferred over “script” StartupItems. 
>> 
>> I have 2 daemons that are Perl scripts, they can run "executable", but the previous version of the port used a "script".
>> Any reason not to change that?
> 
> Yes, executables are preferred. That way, launchd can monitor their lifetime.
> 
> Can you elaborate on what your portfiles were doing before? There may be reasons why they weren't using executables directly, but without seeing how they were set up, it's impossible to say.

Portfile munin @1.4.7:
---
startupitem.create  yes
startupitem.name    munin-node
startupitem.start   "${prefix}/sbin/munin-node"
startupitem.stop    "kill `cat ${prefix}/var/run/munin/munin-node.pid`"
---

/opt/local/sbin/munin-node is a perl program. I see see no reason for daemondo here. launchd KeepAlive would only keep daemondo alive, not the executed munin-node.

The second daemon munin-asyncd is new functionality for munin 2.0 and is also only executing a perl program.


More information about the macports-dev mailing list