Ticket #22570 (new enhancement)
startupitems - RunAtLoad setting
| Reported by: | dreamcat4@… | Owned by: | macports-tickets@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | base | Version: | 1.8.1 |
| Keywords: | Cc: | ||
| Port: |
Description
It seems that we could easily template - out some flexibility in the launchd startupitems. Ideally, to allow users to run a command which affects the "RunAtLoad" plist key.
OnDemand key is also worthwhile to template.
<key>OnDemand</key><false/> <key>RunAtLoad</key><false/>
Attachments
Change History
comment:2 Changed 4 years ago by jmr@…
- Type changed from defect to enhancement
- Summary changed from startupitems - No RunAtLoad setting ? to startupitems - RunAtLoad setting
comment:3 Changed 4 years ago by dreamcat4@…
BUT RunAtLoad generally doesn't play nicely with Daemondo.
Sorry I meant to say "OnDemand" and not RunAtLoad.
comment:4 Changed 4 years ago by dreamcat4@…
In 10.6 you can programmatically manipulate the overrides.plist. Although there is no sanctioned command to do so.
/var/db/launchd.db/com.apple.launchd/overrides.plist
It would be possible to write an api command to insert / modify the relevant xml fragment. For example
<key>org.macports.nginx</key> <dict> <key>Disabled</key> <false/> </dict> <key>org.macports.rabbitmq-server</key> <dict> <key>Disabled</key> <false/> <key>RunAtLoad</key> <true/> </dict> <key>org.macports.rb-chef-indexer</key> <dict> <key>Disabled</key> <false/> </dict> <key>org.macports.rb-chef-server</key> <dict> <key>Disabled</key> <true/> </dict>
Changed 4 years ago by dreamcat4@…
- Attachment portstartupitem.tcl-rrdtool.diff added
Improve startupitems default template
comment:5 Changed 4 years ago by dreamcat4@…
Okay, I've attached some sensible defaults for:
http://trac.macports.org/browser/trunk/base/src/port1.0/portstartupitem.tcl
The OnDemand key itself is now deprecated and defaults to false anyway. Use Sockets / WatchPaths / QueueDirectories keys for setting OnDemand status. That's a more complex area. Until then please use the patch. This patch will make the "port load" command persistent across reboots. Update base and re-install ports to take effect.


BUT RunAtLoad generally doesn't play nicely with Daemondo.
It's all to do with forking and listen ports. Launchd can't hand over the TCP port / sockets its listening in on to anything other than the process it launched. So uh-oh! Running daemondo will *not* work. Period. Launchd must perform certain process - port - handover to the newly launched process, and daemondo doesn't know anything about TCP port / unix socket to hand over. Just running the command directly will solve such problem entirely.
So to use effectively by a startupitem template we need an alternate non-daemondo template. Currently all startupitems templates use daemondo. This would have to change for allowing some bare command running in the generated plist file.