Opened 15 years ago
Closed 11 years ago
#22570 closed enhancement (fixed)
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 (1)
Change History (7)
comment:1 Changed 15 years ago by dreamcat4@…
comment:2 Changed 15 years ago by jmroot (Joshua Root)
Summary: | startupitems - No RunAtLoad setting ? → startupitems - RunAtLoad setting |
---|---|
Type: | defect → enhancement |
comment:3 Changed 15 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 15 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 15 years ago by dreamcat4@…
Attachment: | portstartupitem.tcl-rrdtool.diff added |
---|
Improve startupitems default template
comment:5 Changed 15 years ago by dreamcat4@…
Okay, I've attached some sensible defaults for:
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.
comment:6 Changed 11 years ago by neverpanic (Clemens Lang)
Resolution: | → fixed |
---|---|
Status: | new → closed |
I think this is fixed because we use <key>KeepAlive</key><true/>
on systems > 10.4 now.
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.