#44295 closed enhancement (fixed)
support more than one launchd plist
Reported by: | cro (C. R. Oldham) | Owned by: | jmroot (Joshua Root) |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 2.5.0 |
Component: | base | Version: | 2.3.1 |
Keywords: | Cc: | ctreleaven (Craig Treleaven) | |
Port: |
Description
Greetings,
I am updating the Portfile for Salt. I'm trying to add two variants--"master" and "minion". The default is "minion". Both variants have a startupitem, but at the end of the install (port install salt +master +minion) I get
---> Fetching distfiles for salt ---> Verifying checksums for salt ---> Extracting salt ---> Configuring salt ---> Building salt ---> Staging salt into destroot ---> Creating launchd control script ########################################################### # A startup item has been generated that will aid in # starting salt with launchd. It is disabled # by default. Execute the following command to start it, # and to cause it to launch at startup: # # sudo port load salt ###########################################################\
but my Portfile says
[...] default_variants +minion variant minion { startupitem.create yes startupitem.name salt-minion startupitem.netchange yes startupitem.logevents yes startupitem.logfile ${prefix}/var/log/salt/minion startupitem.executable ${prefix}/bin/salt-minion if ![file exists /opt/local/etc/salt/minion] { file copy ${worksrcpath}/conf/minion /opt/local/etc/salt } } variant master { startupitem.create yes startupitem.name salt-master startupitem.netchange yes startupitem.logevents yes startupitem.logfile ${prefix}/var/log/salt/master startupitem.executable ${prefix}/bin/salt-master [...]
and 'port load salt' returns
port load salt Error: org.macports.load for port salt returned: Launchd plist /Library/LaunchDaemons/org.macports.salt-minion.plist was not found
and indeed only org.macports.salt-master.plist is present in /Library/LaunchDaemons.
So can I not put startup item directives in a variant?
Change History (6)
comment:1 follow-up: 2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Component: | ports → base |
---|---|
Port: | salt removed |
Priority: | High → Normal |
Summary: | Attempting to add more than one LaunchItem → support more than one launchd plist |
Type: | request → enhancement |
comment:2 Changed 10 years ago by cro (C. R. Oldham)
Replying to ryandesign@…:
However, consider whether master and minion might best be implemented as subports.
That sounds good, is there documentation on how subport works? I tried replacing 'variant minion' with 'subport salt-minion' but that doesn't seem to generate the desired result.
comment:3 Changed 7 years ago by ctreleaven (Craig Treleaven)
Cc: | ctreleaven added |
---|
comment:4 Changed 7 years ago by neverpanic (Clemens Lang)
Owner: | changed from macports-tickets@… to jmroot |
---|---|
Status: | new → assigned |
Joshua said he has an approach in mind for this ticket in https://lists.macports.org/pipermail/macports-dev/2018-February/037329.html. Joshua, please consider whether you want to fix this for 2.5.0, and set the milestone if so.
comment:5 Changed 7 years ago by jmroot (Joshua Root)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 Changed 7 years ago by jmroot (Joshua Root)
Milestone: | → MacPorts 2.5.0 |
---|
Yes, you can put startupitem directives in variants. However, it is usually best not to do so because "port load" and "port unload" would not work seamlessly, and furthermore, MacPorts base does not currently have the capability for creating more than one launchd plist in a single port. Of course you can manually create any file and copy it where it needs to go.
However, consider whether master and minion might best be implemented as subports.